Dom-notation-systemid

提供:Dev Guides
移動先:案内検索

DOM-表記オブジェクト属性-systemId

_Notation_のシステム識別子。システム識別子が指定されていない場合はnull。

構文

以下は、_systemId_属性を使用するための構文です。

var sysid = document.doctype.systemId;

_notation_xhtml.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>
   <name>Tanmay Patil</name >
   <company>finddevguides</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("The systemId asscoiated with the notation is:"+ xmlDoc.doctype.systemId);
      </script>
   </body>
</html>

実行

このファイルを_notationattribute_systemsidl_としてサーバーパスに保存します(このファイルとnotation.xmlはサーバーの同じパスにある必要があります)。 次のように出力を取得します-

The systemId asscoiated with the notation is:http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd