Easy Tutorial
❮ Dom Prop Node Childnodes Dom Prop Node Nodename ❯

XML DOM inputEncoding Property



Definition and Usage

The inputEncoding property returns the encoding used for the document (at the time of parsing).

Syntax


Example

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

Example

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

Output:

XML encoding: UTF-8
XML standalone: false
XML version: 1.0
Encoding used when parsing: UTF-8

❮ Dom Prop Node Childnodes Dom Prop Node Nodename ❯