- XML DOM 基础
- XML DOM - 主页
- XML DOM - 概述
- XML DOM - 模型
- XML DOM - 节点
- XML DOM - 节点树
- XML DOM - 方法
- XML DOM - 加载
- XML DOM - 遍历
- XML DOM - 导航
- XML DOM - 访问
- XML DOM 操作
- XML DOM - 获取节点
- XML DOM - 设置节点
- XML DOM - 创建节点
- XML DOM - 添加节点
- XML DOM - 替换节点
- XML DOM - 删除节点
- XML DOM - 克隆节点
- XML DOM 对象
- DOM - 节点对象
- DOM - 节点列表对象
- DOM - 命名节点映射对象
- DOM - DOMImplementation
- DOM - 文档类型对象
- DOM - 处理指令
- DOM - 实体对象
- DOM - 实体引用对象
- DOM - 符号对象
- DOM - 元素对象
- DOM - 属性对象
- DOM - CDATASection 对象
- DOM - 注释对象
- DOM - XMLHttpRequest 对象
- DOM - DOMException 对象
- XML DOM 有用资源
- XML DOM - 快速指南
- XML DOM - 有用资源
- XML DOM - 讨论
DOM - 实体对象属性 - systemId
属性 systemId 返回关联实体的系统标识符,或返回 null。
语法
以下是使用 systemId 属性的语法。
document.doctype.systemId;
示例
notation.xml 内容如下 −
<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <address id = "firstelement"> <name>Tanmay Patil</name > <company>TutorialsPoint</company> <phone>(011) 123-4567</phone> </address>
以下示例演示了 systemId 属性的用法 −
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc(filename) {
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else // code for IE5 and IE6 {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",filename,false);
xhttp.send();
return xhttp.responseXML;
}
</script>
</head>
<body>
<script>
xmlDoc = loadXMLDoc("/dom/notation_xhtml.xml");
document.write("<b>SystemId :</b> "+xmlDoc.doctype.systemId);
</script>
</body>
</html>
执行
将此文件另存为 entity_systemId.html,并保存在服务器路径上(此文件和 notation.xml 应在服务器上的同一路径中)。我们将得到如下所示的输出 −
SystemId : http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
dom_entity_object.htm
广告