Open starhao opened 7 years ago
thats apperently how it works you can provide some options for the parser to preserve order like so: parser = new xml2js.Parser({ explicitChildren: true, preserveChildrenOrder: true, charsAsChildren: true }); but unfortunately the builder fails to put them together correctly like at all, and also the json output is a salad of different formats :( +1 for fixing this issue
If you are parsing Property List files (plists) maybe the plist module is a better fit.
@maa105 how to reconstruction json -> xml
after used new xml2js.Parser({ explicitChildren: true, preserveChildrenOrder: true, charsAsChildren: true });
nothing on this? i mean it has been 4 years and the issue is still there, cannot take an xml input, preserve its node order, get a damn json, and put the xml back together
Nothing on this I'm afraid. I mean, it has been 4 years and still nobody pays me to work on xml2js
. My current schedule does not leave me enough time to do a proper rework of the code to parse it in a way where it is properly roundtripable.
i want parse a xml file , change a value, then save...there will happen a problem.. For example, file's content is :
code :
the xmlResult's content:
why ? and i how to do ? thanks ...