You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when a xml document contains several instances of 2 different kinds of XML tags , xml2json regroups them in 2 different json arrays, ignoring the original sequence of the xml document.
Example:
I think I have to respectfully disagree here. The standard says that you can't depend on the order of keys in a JavaScript object (which is what you end up with in the interpreter), and tag1[0] and tag1[1] are distinct identifiers. The XML clearly provides that the two arrays are tag1 and tag2. As you suggested it be done, there would be extra work required on the part of the coder after the JSON.parse to make sense of the data. In my opinion that is unexpected and in general, unexpectedness is not part of a good design.
To look at it a different way: an XSD can require a specific ordering in XML, but JSON is schema-less.
Hi,
when a xml document contains several instances of 2 different kinds of XML tags , xml2json regroups them in 2 different json arrays, ignoring the original sequence of the xml document.
Example:
gives this result:
which is understandable because the standard says that the names within an object SHOULD be unique.
To conserve this sequential information in the resulting json, I was expecting something like:
But someone may have a better approach to propose.
Could it be considered as an optional feature ?
thanks
The text was updated successfully, but these errors were encountered: