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-parser
To use it as CLI to parse a XML file
$ npm install -g fast-xml-parser
To use it in Browser
- Include it in a
script
tag 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);
}