Latest web development tutorials

XML DOM inputEncoding property

Document Object Reference Document Object

Definition and Usage

inputEncoding property returns the encoding used for the document (in parsing).

grammar

documentObject.inputEncoding


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