XML DOM lookupNamespaceURI() Method
Node object
Definition and Usage
The lookupNamespaceURI() method returns the namespace URI matching the specified prefix on a node.
Syntax
nodeObject.lookupNamespaceURI(prefix)
| Parameters | Description |
|---|---|
| prefix | Required. The prefix. |
Example
The following code snippet uses loadXMLDoc() to load "books_ns.xml" Load into xmlDoc, and in the first
Example
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("book")[0];
document.write(x.lookupNamespaceURI("c"));
Output:
http://www.runoob.com/w3cnote/
Try it »
Node object