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

XML DOM namespaceURI Property

XML DOM namespaceURI Property


Node Object Reference 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 uses loadXMLDoc() to load "books_ns.xml" Load into xmlDoc, and return the namespace URI of the element: </p>

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.runoob.com/xml/

Base URI: https://www.runoob.com/try/demo_source/books_ns.xml

Try it »


Node Object Reference Node object