
定义和用法
xmlEncoding 属性返回文档的编码。
语法
documentObject.xmlEncoding
实例
实例
xmlDoc=loadXMLDoc("books.xml");
document.write("XML encoding: " + xmlDoc.xmlEncoding);
document.write("<br>");
document.write("XML standalone: " + xmlDoc.xmlStandalone);
document.write("<br>");
document.write("XML version: " + xmlDoc.xmlVersion);
document.write("<br>");
document.write("Encoding used when parsing: " + xmlDoc.inputEncoding);
输出:
XML encoding: UTF-8
XML standalone: false
XML version: 1.0
Encoding used when parsing: UTF-8
XML standalone: false
XML version: 1.0
Encoding used when parsing: UTF-8
