Name: libxmljs
Owner: Vivocha
Description: libxml bindings for v8 javascript engine
Created: 2013-08-28 15:03:07.0
Updated: 2016-05-14 22:13:52.0
Pushed: 2016-07-12 13:59:17.0
Homepage: https://github.com/polotek/libxmljs/wiki
Size: 2387
Language: C++
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
LibXML bindings for node.js
libxmljs = require("libxmljs");
xml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<root>' +
'<child foo="bar">' +
'<grandchild baz="fizbuzz">grandchild content</grandchild>' +
'</child>' +
'<sibling>with content!</sibling>' +
'</root>';
xmlDoc = libxmljs.parseXml(xml);
path queries
gchild = xmlDoc.get('//grandchild');
ole.log(gchild.text()); // prints "grandchild content"
children = xmlDoc.root().childNodes();
child = children[0];
ole.log(child.attr('foo').value()); // prints "bar"
Check out the wiki http://github.com/polotek/libxmljs/wiki.
See the examples folder.
install libxmljs
Make sure you have met the requirements for node-gyp. You DO NOT need to manually install node-gyp; it comes bundled with node.