XML DOM baseURIプロパティ


Attr 对象参考手册Attr オブジェクト

定義と使い方

baseURI プロパティは、属性の絶対ベース URI を返します。

構文

attrObject.baseURI


例

次のコードスニペットではloadXMLDoc()を "" xmlDoc に読み込み、"lang" 属性のベース URI を返します:

例

xmlDoc=loadXMLDoc("books_ns.xml"); x=xmlDoc.getElementsByTagName('book'); ​ for(i=0;i<x.length;i++) { document.write("Prefix: " + x.item(i).attributes[0].prefix); document.write("<br>"); document.write("Local name: " + x.item(i).attributes[0].localName); document.write("<br>"); document.write("Namespace URI: " + x.item(i).attributes[0].namespaceURI); document.write("<br>"); document.write("Base URI: " + x.item(i).attributes[0].baseURI); document.write("<br>"); document.write("<br>"); }

試してみる »

Attr 对象参考手册Attr オブジェクト その他の拡張