TOC PREV NEXT INDEX

domref



namespaceURI


The namespace URI of this node, or NULL if it is unspecified.

Syntax

namespace = element.namespaceURI
 

Parameters

namespace is a string that represents the namespace URI of the current node.

Example

In this snippet, a node is being examined for its localName and its namespaceURI. If the namespaceURI matches a variable in which the namespace for the XUL namespace is defined, then the node is understood to be a <browser /> widget from XUL.

if (node.localName == "browser" 
    && node.namespaceURI == kXULNSURI) {
 
// xul browser
 
this.viewee = node.webNavigation.document;
 
...
 
}
 

Notes

This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.

For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always NULL.

Per the Namespaces in XML Specification, an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.

Specification

nameSpaceURI
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX