XML DOM systemId 属性

定義と使用法

systemId 属性は外部 DTD のシステム識別子を返します。

構文

documentObject.doctype.systemId

以下のコードは "note_external_dtd.xml" を xmlDoc に読み込み、外部 DTD のシステム ID を表示します:

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;
}

自分で試してみる