XMLDOM is the most reliable XML parser in the current node environment.
------------------
XMLDOM is a JavaScript implementation of node. js, Rhino and browser of the Web DOM, fully compatible with the Internet Dom Level2, partially compatible with LEVEL3, browser-enabled Domparser and XMLSerializer connection Mouth
Installation:
NPM Install XMLDOM
Example:
var domparser = require (' xmldom '). Domparser;var doc = new Domparser (). parsefromstring ( ' <xml xmlns= ' a ' xmlns:c= './lite ' >\n ' + ' \t< child>test</child>\n ' + ' \t<child></child>\n ' + ' \t<child/>\n ' + ' </xml > ' , ' text/xml ');d oc.documentElement.setAttribute (' x ', ' y ');d Oc.documentElement.setAttributeNS ('./lite ', ' C:x ', ' y2 '); var nsattr = Doc.documentElement.getAttributeNS ('./lite ', ' x ') console.info (nsattr) Console.info (DOC)
Project home: Https://github.com/jindw/xmldom
XML parser for node. JS: XMLDOM