Aanbevolen cursussen:
XML DOM inputEncoding eigenschap
Definitie en gebruik
inputEncoding
Eigenschap retourneert de codering gebruikt voor het document (bij parsing).
documentObject.inputEncoding
Voorbeeld
Hieronderstaande code laadt "books.xml" in xmlDoc en toont de XML-codering, standalone-eigenschap en XML-versie van het document:
var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xhttp.open("GET", "books.xml", true); xhttp.send(); function myFunction(xml) { var xmlDoc = xml.responseXML; document.getElementById("demo").innerHTML = "XML encoding: " + xmlDoc.xmlEncoding + "<br>XML standalone: " + xmlDoc.xmlStandalone + "<br>XML versie: " + xmlDoc.xmlVersion + "<br>Gebruikte encoding bij het parseren: " + xmlDoc.inputEncoding; }