Skip to content

Klortho/libxmljs

 
 

Repository files navigation

@klortho/libxmljs

Build Status

Fork of polotek/libxmljs

Package @klortho/libxmljs, version 0.17.2.

This is a fork of polotek/libxmljs. I opened this pull request, but I haven't gotten any response. This fork adds the ability to set the base-url for XML files, so that references to DTDs, for example, will work.

That pull request is from the master branch, here. So, I set the default branch to cfm-baseurl-for-xml, and published my new version from here.

See also the cfm-libxmljs-mt branch, which was where I started -- forked from libxmljs-mt. I had originally submitted this PR on that repo, but the author there suggested that I submit my PR upstream, so that's what I did.

I gave it version 0.17.2, which is one patch up from libxmljs-mt.


LibXML bindings for node.js

Install with:

npm install libxmljs
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/polotek/libxmljs/wiki.

See the examples folder.

Contributing

To do development, so these once:

npm install -g node-gyp
npm install
npm test
npm link

From then on, if you make changes:

make         #=> incremental build
npm build .  #=> complete rebuild
npm test

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.

About

libxml bindings for v8 javascript engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 60.6%
  • JavaScript 38.8%
  • Other 0.6%