Latest web development tutorials

XML DOM xmlEncoding property

Document Object Reference Document Object

Definition and Usage

xmlEncoding property returns the document encoding.

grammar

documentObject.xmlEncoding


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