XML parsing utilities.
npm i @svta/cml-xml
import { parseXml } from "@svta/cml-xml";
const obj = parseXml(
`<root>
<child>text</child>
<ns:tag>content</ns:tag>
</root>`
);
const root = obj.childNodes[0];
console.log(root.nodeName);
// root
console.log(root.childNodes[0].nodeName, root.childNodes[0].childNodes[0].nodeValue);
// child text
console.log(root.childNodes[1].nodeName, root.childNodes[1].prefix, root.childNodes[1].localName);
// ns:tag ns tag
A collection of tools for working with XML.