xml-js-builder
This is a npm
library which ease the use of XML with namespaces.
This way, parsing <tag xmlns="ns"/>
will be reachable by .find('ns:tag')
instead of having to check the attributes to know if it is in the right namespace.
The xmljs.XML.parse(...)
can parse XML, JSON (compact and extended) from xml-js
.
Install
npm install xml-js-builder
Usage
const xmljs = ; const xml = xmljsXML; try const text = xml; const texts = xml; // [...]catchex console;
const xmljs = ; // <d:multistatus xmlns:d="DAV:" xmlns:x="ok:"> ... </d:multistatus>const xml = 'd:multistatus' 'xmlns:d': 'DAV:' 'xmlns:x': 'ok:';// <d:deep xmlns="ttt:"><test/></d:deep>xml;// <d:node2>Ok1</d:node2>xml// <d:node2>Ok2</d:node2>xml// <d:tag/>xml// <x:test/>xml// <d:nons>yes</d:nons>xml// <d:node2>Ok3</d:node2>xml console;console;