RunKit + npm: xml-js

var convert = require('xml-js'); var xml = '<?xml version="1.0" encoding="utf-8"?>' + '<note importance="high" logged="true">' + ' <title>Happy</title>' + ' <todo>Work</todo>' + ' <todo>Play</todo>' + '</note>'; var result1 = convert.xml2json(xml, {compact: true, spaces: 4}); var result2 = convert.xml2json(xml, {compact: false, spaces: 4}); console.log(result1, '\n', result2);
Created from: https://runkit.com/npm/xml-js
Loading…

3 comments

  • posted 7 years ago by xujif
    sws
  • posted 3 years ago by sukki
    test
  • posted 3 years ago by pebatista84
    test

sign in to comment