The lookupNamespaceURI() method returns the namespace matching the specified prefix on the current node.
Parameter | Description |
---|---|
prefix | Required. A string that specifies prefix to find |
The following code fragment loads "books_ns.xml" into xmlDoc using loadXMLDoc() and finds the namespace URI for the "c" prefix in the first <book> element:
Output: