Thuộc tính XML DOM systemId
❮ Đối tượng DocumentType
Thí dụ
Đoạn mã sau tải " note_external_dtd.xml " vào xmlDoc và hiển thị id hệ thống cho DTD bên ngoài:
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;
}
Đầu ra của đoạn mã trên sẽ là:
note.dtd
Định nghĩa và Cách sử dụng
Thuộc tính systemId trả về định danh hệ thống của DTD bên ngoài.
Cú pháp
documentObject.doctype.systemId
❮ Đối tượng DocumentType