Removes a namespace.
Syntax
remove(name:string) : string
Parameters |
Description |
name |
A prefix in the namespace context. |
Return value |
Description |
string |
Undefined. |
Usage
The method removes the specified namespace
from the namespace context. If the prefix does not exist, nothing
happens.
Examples
This button
onclick
event
removes a namespace. The namespace context, prefix, and display area
are global objects.
if(sessionScope.ns != null) {
var ns = sessionScope.ns;
var p = requestScope.prefix;
if(ns.getNamespaceURI(p) != null) {
ns.remove(p);
requestScope.msg = "Namespace " + p + " removed";
} else {
requestScope.msg = "No namespace " + p;
}
} else {
requestScope.msg = "No namespaces";
}