包含DTD中声明的符号的属性表示法。
示例
文件:notation.xml 的内容如下 -
<?xml version = "1.0"?>
<!DOCTYPE address [
   <!ELEMENT address (#PCDATA)>
   <!NOTATION name PUBLIC "zaixian">
   <!ATTLIST address category NOTATION (name) #REQUIRED>
]>
<address name = "zaixian">Hello zaixian!</address>
以下示例演示了符号属性的用法 -
<!DOCTYPE html>
<html>
   <meta charset="utf-8"/>
    <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("/notation.xml");
         var notations = xmlDoc.doctype.notations;
         document.write("notations: "+notations);
         document.write("Item "+notations.getNamedItem('zaixian'));
      </script>
   </body>
</html>
浏览器不太支持此集合,但没有其他方法可以检索此数据。
执行上面示例代码,得到以下结果 -

						上一篇:
								DOM DocumentType对象
												下一篇:
								ProcessingInstruction对象
												
						
						
					
					
					