-
Notifications
You must be signed in to change notification settings - Fork 607
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
Order of elements is being destroyed #499
Comments
Yeah they have no fix for that except mixing three options which are:
And honestly, the output is twisted as hell with all the data duplicated. I cannot afford that, I'm switching to another library. |
@UnbearableBear May I ask which one? I also can't seem to get order preserving roundtrips out of this lib... |
@bluenote10 I use this one which works fine to me but I'm not sure it is maintained anymore https://github.com/nashwaan/xml-js |
Thank you for the alternative. I tried I think it's not intuitive to just keep the xml content order, and yes the result is too much duplicated. |
Ran into this issue and switched to xml-js to fix. |
Faced the same issue, unfortunately there was no way to get the exact order. Also if your input xml is deeply nested, you might find the |
Parsing the following Xml:
"<a id='1'><b id='b1'/><c id='c1'/><b id='b2'/></a>"
yields:
{"a":{"$":{"id":"1"},"b":[{"$":{"id":"b1"}},{"$":{"id":"b2"}}],"c":[{"$":{"id":"c1"}}]}}
which destroys the fact that c1 occurs before b2. Sample test file:
The text was updated successfully, but these errors were encountered: