Closed thuus closed 1 year ago
const { XMLParser, XMLBuilder, XMLValidator } = require("fast-xml-parser"); const options = { parseTrueNumberOnly: true //if true then values like "+123", or "0123" will not be parsed as number. }; const xmlInput = '<item>08</item>'; console.log(xmlInput); const parser = new XMLParser(options); let jsonData = parser.parse(xmlInput); console.log(JSON.stringify(jsonData)); const builder = new XMLBuilder(); const xmlOutput = builder.build(jsonData,options) console.log(xmlOutput);
Would you like to work on this issue?
Bookmark this repository for further updates.
I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.
Please check the docs
Checklist
Code
Output
expected data
Would you like to work on this issue?
Bookmark this repository for further updates.