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
I have been using Node.js exec() with jq/yq/xq to convert XML<->JSON, and comparing the output for XML->JSON with this xml2js to xq, the JSON data returned is different.
Is there a reason for the difference? or a way to configure the output to match?
Edited to add:
let parser = new xml2js.Parser({
attrNameProcessors: [ function (name) { console.log(name); return name } ]
});
the names of the attributes still do not appear to retain the '@' symbol at the beginning. I couldn't find any options that preserve the data to appear exactly identical as the source XML data without modification. Is there something I missed?
The text was updated successfully, but these errors were encountered:
I have been using Node.js exec() with jq/yq/xq to convert XML<->JSON, and comparing the output for XML->JSON with this xml2js to xq, the JSON data returned is different.
value of
stdout
appears as:but when using:
the output appears as:
Is there a reason for the difference? or a way to configure the output to match?
Edited to add:
the
name
s of the attributes still do not appear to retain the '@' symbol at the beginning. I couldn't find any options that preserve the data to appear exactly identical as the source XML data without modification. Is there something I missed?The text was updated successfully, but these errors were encountered: