XML DOM xmlStandalone 屬性
Document 對象
定義和用法
xmlStandalone 屬性設(shè)置或返回文檔是否為 standalone。
語法
documentObject.xmlStandalone
實例
下面的代碼片段使用 loadXMLDoc() 把 "books.xml" 載入 xmlDoc 中,并顯示 XML 編碼、standalone 屬性和文檔的 XML 版本:
實例
xmlDoc=loadXMLDoc("books.xml");
document.write("XML encoding: " + xmlDoc.xmlEncoding);
document.write("
");
document.write("XML standalone: " + xmlDoc.xmlStandalone);
document.write("
");
document.write("XML version: " + xmlDoc.xmlVersion);
document.write("
");
document.write("Encoding when parsing: " + xmlDoc.inputEncoding);
輸出:
XML encoding: ISO-8859-1
XML standalone: false
XML version: 1.0
Encoding when parsing: ISO-8859-1
嘗試一下 ?
Document 對象
更多建議: