当前位置: 首页 > 网络学院 > XML相关教程 > XML DOM > internalSubset 属性
The internalSubset property returns the internal DTD as a string (without the delimiting square brackets), or null if there is none.
internalSubset属性的作用是:以字符串的形式返回内部DTD(不包含“括号”);或者,如果内部DTD不存在将返回空值。
documentObject.doctype.internalSubset |
In all examples, we will use the XML file note_internal_dtd.xml, and the JavaScript function loadXMLDoc().
在所有案例中,我们将使用“note_internal_dtd.xml”文件以及JavaScript 函数“loadXMLDoc()”。
The following code fragment displays the internal DTD as a string:
下面的代码片断将以一个字符串的形式显示内部DTD:
xmlDoc=loadXMLDoc("note_internal_dtd.xml"); document.write(xmlDoc.doctype.internalSubset); |
Output:
输出结果:
<!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> <!ENTITY writer "Donald Duck."> <!ENTITY copyright "Copyright W3Schools"> |