XML DOM systemId 속성
❮ DocumentType 객체
예시
다음 코드 조각은 " 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;
}
위 코드의 출력은 다음과 같습니다.
note.dtd
정의 및 사용
systemId 속성은 외부 DTD의 시스템 식별자를 반환합니다.
통사론
documentObject.doctype.systemId
❮ DocumentType 객체