XML DOM xmlEncoding అంశం

నిర్వచనం మరియు వినియోగం

xmlEncoding అంశం పత్రం యొక్క కోడింగ్ను తిరిగి ఇస్తుంది.

సంకేతం

documentObject.xmlEncoding

ఉదాహరణ

ఈ కోడు "books.xml" ను xmlDoc లోకి లోడ్ చేస్తుంది,, పత్రం యొక్క XML కోడింగ్ను మరియు standalone అంశాన్ని మరియు XML వెర్షన్ను ప్రదర్శిస్తుంది:

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 స్టాండాలోనే: " + xmlDoc.xmlStandalone +
    "<br>XML వర్షన్: " + xmlDoc.xmlVersion +
    "<br>పార్సింగ్ వద్ద ఉపయోగించబడిన ఎంకోడింగ్: " + xmlDoc.inputEncoding;
}

స్వయంగా ప్రయత్నించండి