Fast XML Parser is a javascript library to parse XML into JS Object, JSON or to build XML from JS Object without losing any information.
The aim of this library is to provide fast error free solution to deal with XML data format in javascript.
To use XML parser in your node js project
$ npm install fast-xml-parserTo use it as CLI to parse a XML file
$ npm install -g fast-xml-parserTo use it in Browser
- Include it in a
scripttag from some CDN
This documentation is based on how you can use FXP(fast-xml-parser) in node js.
const {XMLParser, XMLBuilder, XMLValidator} = require('fast-xml-parser');
if(XMLValidator.validate()){
const parser = new XMLParser();
let jsonObj = parser.parse(xmlData);
const builder = new XMLBuilder();
let sampleXmlData = builder.build(jsonObj);
}