Package net.sf.saxon.om
Class NamespaceBinding
java.lang.Object
net.sf.saxon.om.NamespaceBinding
- All Implemented Interfaces:
- Iterable<NamespaceBinding>,- NamespaceBindingSet
Represents the binding of a prefix to a URI. Also, in some contexts, represents an unbinding, by
 virtue of the URI being set to a zero length string.
- Since:
- 9.4
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final NamespaceBindingstatic final NamespaceBinding[]static final NamespaceBinding
- 
Constructor SummaryConstructorsConstructorDescriptionNamespaceBinding(String prefix, NamespaceUri uri) Create a binding of a prefix to a URI
- 
Method SummaryModifier and TypeMethodDescriptionbooleanTest if this namespace binding is the same as anotherGet the URI part of the bindinggetNamespaceUri(String prefix) Get the prefix part of the bindinginthashCode()booleanAsk whether this is an undeclaration of the default prefix, that is, a namespace binding corresponding toxmlns=""booleanAsk whether this is a binding for the XML namespaceiterator()Returns an iterator over this singleton set of namespace bindings.toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
XML
- 
DEFAULT_UNDECLARATION
- 
EMPTY_ARRAY
 
- 
- 
Constructor Details- 
NamespaceBindingCreate a binding of a prefix to a URI- Parameters:
- prefix- the prefix: either an NCName, or a zero-length string to bind the default namespace. Must not be null.
- uri- the namespace URI: either a URI, or a zero-length string to unbind the prefix. Must not be null.
 
 
- 
- 
Method Details- 
getNamespaceUri- Specified by:
- getNamespaceUriin interface- NamespaceBindingSet
 
- 
getPrefixGet the prefix part of the binding- Returns:
- the prefix. Never null. The zero-length string indicates a binding for the default namespace.
 
- 
getNamespaceUriGet the URI part of the binding- Returns:
- the URI. Never null. The zero-length string indicates an unbinding of the prefix. For the default namespace (prefix="") this indicates that the prefix refers to names in no namespace; for other prefixes, it indicates that the prefix is not bound to any namespace and therefore cannot be used.
 
- 
isXmlNamespacepublic boolean isXmlNamespace()Ask whether this is a binding for the XML namespace- Returns:
- true if this is the binding of the prefix "xml" to the standard XML namespace.
 
- 
isDefaultUndeclarationpublic boolean isDefaultUndeclaration()Ask whether this is an undeclaration of the default prefix, that is, a namespace binding corresponding toxmlns=""- Returns:
- true if this corresponding to xmlns=""
 
- 
iteratorReturns an iterator over this singleton set of namespace bindings.- Specified by:
- iteratorin interface- Iterable<NamespaceBinding>
- Returns:
- an Iterator.
 
- 
equalsTest if this namespace binding is the same as another
- 
hashCodepublic int hashCode()
- 
toString
 
-