-
-
Notifications
You must be signed in to change notification settings - Fork 334
Closed
Description
In case a node exists multiple time in the same parent, it will automatically be converted to a JS array.
If the node occurs only once however in the dataset (eventhough it could occur multiple times in theory), the conversion will create an object cause it has no way of knowing it should convert it to an array.
Other libraries have support for this by adding an array in the parsing options containing a list of elements that always need to be converted to an array.
Example https://github.com/abdolence/x2js has support via 'arrayAccessFormPaths'.
I am surprised this basic conceptual issue in xml to json conversion is not yet covered by this widely used library. Makes for a lot of painful checks on the output.
DazChong
Metadata
Metadata
Assignees
Labels
No labels