Package com.adobe.xfa.dom
Class NamespaceContextImpl
java.lang.Object
com.adobe.xfa.dom.NamespaceContextImpl
- All Implemented Interfaces:
NamespaceContext
Implements the interface javax.xml.namespace.NamespaceContext using the
namespace prefix mapping in scope from an existing Node.
Normally, the namespace prefixes mappings in an XPath expression are unrelated to any namespace mappings in the XML document, but this implementation uses the existing in-scope namespace mappings from some node in the document to define a set of mappings.
Additional mappings can be added explicitly.
-
Constructor Summary
ConstructorsConstructorDescriptionNamespaceContextImpl(Node node) Creates a new NamespaceContext using mappings from an existing node in some document. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamespaceMapping(String prefix, String namespaceURI) Add a namespace mapping this namespace context.getNamespaceURI(String prefix) getPrefixes(String namespaceURI)
-
Constructor Details
-
NamespaceContextImpl
Creates a new NamespaceContext using mappings from an existing node in some document.- Parameters:
node- a node to use the in-scope namespace mappings from; ifnullthen no namespace mappings are defined.
-
-
Method Details
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixesin interfaceNamespaceContext
-
addNamespaceMapping
Add a namespace mapping this namespace context.Additional namespace mappings can be added to this NamespaceContext -- mappings which aren't expressed anywhere in the document's elements.
Mappings provided through this method will be used only as a last resort. If an element's mapping redefines either the prefix or namespace URI given in this call, the element's definition will take precedence for it and its descendants.
- Parameters:
prefix- Namespace prefix, empty string for default mapping namespace.namespaceURI- Namespace URI associated with the prefix.
-