XML DOM internalSubset 屬性
DocumentType 對象
定義和用法
internalSubset 屬性以字符串形式返回內(nèi)部 DTD(無定界方括號),如果沒有則返回 null。
語法
documentObject.doctype.internalSubset
實(shí)例
下面的代碼片段使用 loadXMLDoc() 把 "books.xml" 載入 xmlDoc 中,并以字符串形式內(nèi)部 DTD:
xmlDoc=loadXMLDoc("note_internal_dtd.xml");
document.write(xmlDoc.doctype.internalSubset);
輸出:
<!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 W3Cschools">
DocumentType 對象
更多建議: