网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: XML DOM :: internalSubset 属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

internalSubset 属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 浏览:1189 :: ::

Definition and Usage
定义和用法

The internalSubset property returns the internal DTD as a string (without the delimiting square brackets), or null if there is none.
internalSubset属性的作用是:以字符串的形式返回内部DTD(不包含“括号”);或者,如果内部DTD不存在将返回空值。

Syntax
语法

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()”。

Example
案例

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">

评论 (0) All