node1-libxmljsmt-myh
Version:
multi-threaded libxml bindings for v8 javascript engine
28 lines (21 loc) • 857 B
JavaScript
var libxml = require('../index');
module.exports.text = function(assert) {
var doc = libxml.parseXml('<root>child</root>');
assert.equal('text', doc.child(0).type());
assert.equal('text', doc.child(0).name());
assert.done();
};
module.exports.comment = function(assert) {
var doc = libxml.parseXml(' ' +
'<root><!-- comment --></root>');
assert.equal('comment', doc.child(0).type());
assert.equal('comment', doc.child(0).name());
assert.done();
};
module.exports.cdata = function(assert) {
var doc = libxml.parseXml(' ' +
'<root><![CDATA[cdata text]]></root>');
assert.equal('cdata', doc.child(0).type());
assert.equal(undefined, doc.child(0).name());
assert.done();
};