Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): ensure sitemap & url are arrays #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chowson
Copy link

@chowson chowson commented Nov 11, 2024

Issue

  • When only 1 <sitemap> or url node, fast-xml-parser does not create an array. This breaks when trying to iterate over the sites node.

Fix

  • Added an option to the parser to force these nodes to be an array, even when only 1 element in the XML.

@chowson
Copy link
Author

chowson commented Nov 11, 2024

@seantomburke Not sure why one of the tests is failing, I couldn't get the test to run when cloning with no changes.

Hope the change makes sense.

@saitho
Copy link

saitho commented Nov 28, 2024

Works well for me. Without this change I can't use the latest version. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants