XML DOM xmlVersion 属性

Dokumentobjektets referenshandbok

定义和用法

xmlVersion 属性可设置或返回文档的 XML 版本。

语法:

documentObject.xmlVersion

exempel

I alla exempel kommer vi att använda XML-filer books.xmloch JavaScript-funktioner loadXMLDoc()

Följande kodsnutt kan visa XML:s kodning, standalone-attribut och dokumentets XML-version:

xmlDoc=loadXMLDoc("books.xml");
document.write("XML kodning: " + 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("Kodning vid tolkning: " + xmlDoc.inputEncoding);

Uttan

XML kodning: ISO-8859-1
XML standalone: false
XML-version: 1.0
Kodning vid tolkning: ISO-8859-1

Dokumentobjektets referenshandbok