NamespaceContextImpl (JavaScript)

Manipulates a namespace context.

Defined in

DOM (JavaScript)


Method Description
NamespaceContextImpl() Creates a namespace context.


This class inherits the methods of NamespaceContext (JavaScript). Other methods are in addition.


The name and prefix form a namespace. The namespace is added if the prefix does not already exist in the namespace context. If the prefix already exists, this namespace replaces the existing namespace.


This button onclick event creates a namespace context if it does not yet exist then adds or replaces a namespace. The prefix and URI for the namespace are global objects defined elsewhere on the page before the button is clicked. The namespace context is a global object so other code can use it.
if(sessionScope.ns == null) {
	sessionScope.ns = new NamespaceContextImpl();
	requestScope.prefix, requestScope.uri);