The lookupNameSpaceURI() method returns the namespace URI associated with a given prefix.
The lookupNamespaceURI() method is supported in all major browsers.
Note: Internet Explorer 9 and earlier does not support this method.
Parameter | Type | Description |
---|---|---|
prefix | String | Required. Specifies the prefix to look for |
Type | Description |
---|---|
String | The namespace URI associated with the specified prefix |
DOM Version | Core Level 3 Node Object |
---|
The following code fragment loads "books_ns.xml" into xmlDoc using loadXMLDoc() and finds the namespace URI for the given "c" prefix:
Output: