0.19.12 • Published 1 year ago

@manhydra/libxmljs v0.19.12

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Libxmljs

NOTE:

This fork is only to serve the purpose of maintaining existing functionality and security through dependency upgrades and minor code changes.

For information on new developments, visit the pull requests and issues sections from the upstream.

Build Status

AppVeyor Build Status

LibXML bindings for node.js

var libxmljs = require("libxmljs");
var xml =  '<?xml version="1.0" encoding="UTF-8"?>' +
           '<root>' +
               '<child foo="bar">' +
                   '<grandchild baz="fizbuzz">grandchild content</grandchild>' +
               '</child>' +
               '<sibling>with content!</sibling>' +
           '</root>';

var xmlDoc = libxmljs.parseXml(xml);

// xpath queries
var gchild = xmlDoc.get('//grandchild');

console.log(gchild.text());  // prints "grandchild content"

var children = xmlDoc.root().childNodes();
var child = children[0];

console.log(child.attr('foo').value()); // prints "bar"

Support

API and Examples

Check out the wiki http://github.com/libxmljs/libxmljs/wiki.

See the examples folder.

Installation via npm

npm install libxmljs

Contribute

Start by checking out the open issues. Specifically the desired feature ones.

Requirements

Make sure you have met the requirements for node-gyp. You DO NOT need to manually install node-gyp; it comes bundled with node.