XML DOM namespaceURI Property
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
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