XML DOM namespaceURIProperty


Node object

Definition and Usage

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

Syntax

nodeObject.namespaceURI


Example

The following code snippet usesloadXMLDoc()put "books_ns.xml"Load into xmlDoc, and return the namespace URI of the <title> element:"

Example

xmlDoc=loadXMLDoc("books_ns.xml"); x=xmlDoc.getElementsByTagName('title'); for(i=0;i<x.length;i++) { document.write(x.item(i).namespaceURI); document.write(""); }

The code above will output:

Namespace URI: http://www.example.com/xml/
Base URI: https://www.example.com/try/demo_source/books_ns.xml

Try it Yourself »

Node objectother extensions