Właściwość identyfikatora systemu XML DOM
❮ Obiekt typu dokumentu
Przykład
Poniższy fragment kodu ładuje plik „ note_external_dtd.xml ” do xmlDoc i wyświetla identyfikator systemu dla zewnętrznego DTD:
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "note_external_dtd.xml", true);
xhttp.send();
function myFunction(xml) {
var xmlDoc = xml.responseXML;
document.getElementById("demo").innerHTML =
xmlDoc.doctype.systemId;
}
Wynikiem powyższego kodu będzie:
note.dtd
Definicja i użycie
Właściwość systemId zwraca identyfikator systemowy zewnętrznego DTD.
Składnia
documentObject.doctype.systemId
❮ Obiekt typu dokumentu