
定义和用法
entities 属性返回包含有在 DTD 中所声明的外部实体和内部实体的 NamedNodeMap。
语法
documentObject.doctype.entities
实例
下面的代码片段使用 loadXMLDoc() 把 "note_internal_dtd.xml" 载入 xmlDoc 中,并显示在 DTD 中声明过的实体的节点名称和节点类型:
实例
xmlDoc=loadXMLDoc("note_internal_dtd.xml"); x=xmlDoc.doctype.entities;for (i=0;i<x.length;i++){ document.write("Nodename: " + x.item(i).nodeName); document.write("<br>"); document.write("Nodetype: " + x.item(i).nodeType); document.write("<br>");}
知识兔 »
输出:
Nodename: writer
Nodetype: 6
Nodename: copyright
Nodetype: 6
Nodetype: 6
Nodename: copyright
Nodetype: 6
知识兔 »
