Easy Tutorial
❮ Dom Cdatasection Prop Element Ownerdocument ❯

XML DOM namespaceURI Property



Definition and Usage

The namespaceURI property sets or returns the namespace URI of a node.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books_ns.xml" into xmlDoc and returns the namespace URI of the <title> element:

Example

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName('title');

for(i=0;i&lt;x.length;i++)
{
  document.write(x.item(i).namespaceURI);
  document.write("");
}

The above code will output:

Namespace URI: http://www.tutorialpro.org/xml/
Base URI: https://www.tutorialpro.org/try/demo_source/books_ns.xml

❮ Dom Cdatasection Prop Element Ownerdocument ❯