XML DOM lookupPrefix() Method
Complete Node Object Reference
Definition and Usage
The lookupPrefix() method returns the prefix matching the
specified namespace URI on a node.
Syntax
nodeObject.lookupPrefix(URI)
|
Parameter |
Description |
URI |
Required. The namespace URI |
Example
The following code fragment loads "books_ns.xml"
into xmlDoc using
loadXMLDoc() and finds the prefix for the namespace URI in the
first
<book> element:
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("book")[0];
document.write(x.lookupPrefix("http://www.w3schools.com/children/"));
|
Output:
Try-It-Yourself Demos
lookupPrefix() - Get a prefix by namespace
Complete Node Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|