XML DOM internalSubset 屬性


DocumentType 對象參考手冊 DocumentType 對象

定義和用法

internalSubset 屬性以字串形式返回內部 DTD(無定界方括號),如果沒有則返回 null。

語法

documentObject.doctype.internalSubset


實例

下麵的代碼片段使用 loadXMLDoc() 把 "note_internal_dtd.xml" 載入 xmlDoc 中,並以字串形式內部 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 W3Schools">


DocumentType 對象參考手冊 DocumentType 對象