Assigns the specified XML namespace binding to the specified element.
The effect of this function will be that as if the namespace binding was
actually specified in the original XML element (associated with the GOMElement
provided in the parameter), like this:
<element xmlns:prefix="namespaceURI" ... >
...
</element>
For instance, when element with unqualified name adopts a new binding for the default namespace, the element's name will remain in its original namespace (which was the default one before adopting the binding).
xs:QName
type) found within its scope.
For instance, when the following XSD declaration falls within the adopted binding's scope:
the qualified name<xs:element name="SomeName" type="SomeType">
'SomeType'
will be resolved
including against that binding too.
Note:
When the binding is successfully assigned, a#NAMESPACE
pseudo-element representing it will be created (or updated). The'original'
attribute of that element will be setfalse
to indicates that this namespace binding is adopted (not found in the original XML document).
Parameters:
element
Specify the context element where the new namespace binding is to be adopted.If the specified
GOMElement
element represents some actual XML element, the binding will be assigned exactly to it.When this is a pseudo-element associated with some non-element XML DOM node, the binding will be assigned to the nearest XML element ancestor of that node.
prefix
Specify the namespace binding's prefix.An empty string will indicate the default namespace binding.
namespaceURI
Specify the namespace URI.An empty string will specify "no namespace".
Returns:
true
- the binding has been successfully assigned;
false
- the binding cannot be assigned (e.g. the passed context element is not associated with any XML DOM node, or it has no XML element ancestor, or the XML element already has an original binding for the same prefix)
See Also:
All Element Types | #NAMESPACE