Returns Declarations(this.prefixNamespaceMap ++ declarations.prefixNamespaceMap)
Returns Declarations(this.prefixNamespaceMap -- prefixes)
Returns true if this Declarations is empty.
Returns true if this Declarations is empty. Faster than comparing this Declarations against the empty Declarations.
Returns an adapted copy of this Declarations, but retaining only the default namespace, if any
Returns an adapted copy of this Declarations, but retaining only the undeclarations, if any
Creates a String
representation of this Declarations
, as it is shown in an XML element
Returns an adapted copy of this Declarations, but without the default namespace, if any
Returns an adapted copy of this Declarations, but without any undeclarations, if any
Namespace declarations (and undeclarations), typically at the level of one element.
For example, consider the following XML:
Then only the root element contains namespace declarations, viz.:
The
Declarations
is backed by a map from prefixes (or the empty string for the default namespace) to namespace URIs (or the empty string). If the mapped value is the empty string, it is an undeclaration.Prefix 'xml' is not allowed as key in this map. That prefix, mapping to namespace URI 'http://www.w3.org/XML/1998/namespace', is always available, without needing any declaration.
This class does not depend on the
Scope
class.There are no methods for subset relationships on namespace declarations (unlike for class
Scope
). After all, in the presence of namespace undeclarations, such a subset relationship would become a bit unnatural.