forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext_node.ts
More file actions
23 lines (19 loc) · 807 Bytes
/
text_node.ts
File metadata and controls
23 lines (19 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as libxml from "../index";
module.exports.text = function (assert: any) {
var doc = libxml.parseXml('<?xml version="1.0"?><root>child</root>');
assert.equal("text", doc.child(0)?.type());
assert.equal("text", doc.child(0)?.name());
assert.done();
};
module.exports.comment = function (assert: any) {
var doc = libxml.parseXml('<?xml version="1.0"?>' + "<root><!-- comment --></root>");
assert.equal("comment", doc.child(0)?.type());
assert.equal("comment", doc.child(0)?.name());
assert.done();
};
module.exports.cdata = function (assert: any) {
var doc = libxml.parseXml('<?xml version="1.0"?>' + "<root><![CDATA[cdata text]]></root>");
assert.equal("cdata", doc.child(0)?.type());
assert.equal("cdata", doc.child(0)?.name());
assert.done();
};