aaronczichon / xmlToJsonTs

Typescript module to convert an XML string into JSON
3 stars 0 forks source link

xmlToJsonTs

Parsing a XML string into JSON using Typescript.

Sample

import { XmlParser, IParserConfiguration } from 'xmlToJsonTs';

let config = <IParserConfiguration> { };
config.removeLineBreaks = true;
config.removeComments = true;
config.transformTextOnly = true;

let parser = new XmlParser();
let json = parser.toJson('<YourXmlString></YourXmlString>', config);
console.log(json);