Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM lookupNamespaceURI() Method

XML DOM lookupNamespaceURI() Method


Node Object Reference 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 look up the namespace URI to which the prefix "c" belongs in an element:

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 Reference Node object