libxmljs
Version:
libxml bindings for v8 javascript engine
25 lines • 1.22 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var libxml = require("../index");
module.exports.text = function (assert) {
var _a, _b;
var doc = libxml.parseXml('<root>child</root>');
assert.equal("text", (_a = doc.child(0)) === null || _a === void 0 ? void 0 : _a.type());
assert.equal("text", (_b = doc.child(0)) === null || _b === void 0 ? void 0 : _b.name());
assert.done();
};
module.exports.comment = function (assert) {
var _a, _b;
var doc = libxml.parseXml(' ' + "<root><!-- comment --></root>");
assert.equal("comment", (_a = doc.child(0)) === null || _a === void 0 ? void 0 : _a.type());
assert.equal("comment", (_b = doc.child(0)) === null || _b === void 0 ? void 0 : _b.name());
assert.done();
};
module.exports.cdata = function (assert) {
var _a, _b;
var doc = libxml.parseXml(' ' + "<root><![CDATA[cdata text]]></root>");
assert.equal("cdata", (_a = doc.child(0)) === null || _a === void 0 ? void 0 : _a.type());
assert.equal("cdata", (_b = doc.child(0)) === null || _b === void 0 ? void 0 : _b.name());
assert.done();
};
//# sourceMappingURL=text_node.js.map