Latest web development tutorials

XML DOM xmlVersion property

Document Object Reference Document Object

Definition and Usage

xmlVersion property sets or returns the XML version of the document.

grammar

documentObject.xmlVersion


Examples

The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, and displays the XML version of the XML encoding, standalone attribute and document:

Examples

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);

Output:

XML encoding: ISO-8859-1
XML standalone: false
XML version: 1.0
Encoding when parsing: ISO-8859-1

try it"

Document Object Reference Document Object