Name: libxmljs
Owner: BBC
Description: libxml bindings for v8 javascript engine
Created: 2015-04-17 14:31:44.0
Updated: 2016-09-26 10:52:03.0
Pushed: 2015-04-17 14:32:46.0
Homepage: https://github.com/polotek/libxmljs/wiki
Size: 4252
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
Start by checking out the open issues. Specifically the desired feature ones.
Make sure you have met the requirements for node-gyp. You DO NOT need to manually install node-gyp; it comes bundled with node.