Skip to content

Instantly share code, notes, and snippets.

@thegreatape
Created August 21, 2010 22:02
Show Gist options
  • Save thegreatape/542916 to your computer and use it in GitHub Desktop.
Save thegreatape/542916 to your computer and use it in GitHub Desktop.
var sys = require('sys');
var libxmljs = require('libxmljs');
var xml = "<test>\n <![CDATA[My god, it's full of segfaults!]]>\n</test>";
var doc = libxmljs.parseXmlString(xml);
var node = doc.get('//test');
var children = node.childNodes();
for (var i in children) {
sys.debug(i);
sys.debug(children[i]);
sys.debug(children[i].name());
sys.debug('----');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment