XML DOM namespaceURI 属性

定义和用法
namespaceURI 属性设置或返回节点的命名空间 URI。
语法
nodeObject.namespaceURI
实例
下面的代码片段使用 loadXMLDoc() 把 "books_ns.xml" 载入 xmlDoc 中,并返回 <title> 元素的命名空间 URI:
实例
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName('title');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).namespaceURI);
document.write("");
}
上面的代码将输出:
Namespace URI: /doc/xml/
Base URI: //try/demo_source/books_ns.xml
Base URI: //try/demo_source/books_ns.xml
尝试一下 »
