Package com.adobe.xfa.dom
Class NamespaceContextImpl
- java.lang.Object
-
- com.adobe.xfa.dom.NamespaceContextImpl
-
- All Implemented Interfaces:
javax.xml.namespace.NamespaceContext
public class NamespaceContextImpl extends java.lang.Object implements javax.xml.namespace.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
Constructors Constructor Description NamespaceContextImpl(org.w3c.dom.Node node)
Creates a new NamespaceContext using mappings from an existing node in some document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNamespaceMapping(java.lang.String prefix, java.lang.String namespaceURI)
Add a namespace mapping this namespace context.java.lang.String
getNamespaceURI(java.lang.String prefix)
java.lang.String
getPrefix(java.lang.String namespaceURI)
java.util.Iterator<java.lang.String>
getPrefixes(java.lang.String namespaceURI)
-
-
-
Method Detail
-
getNamespaceURI
public java.lang.String getNamespaceURI(java.lang.String prefix)
- Specified by:
getNamespaceURI
in interfacejavax.xml.namespace.NamespaceContext
-
getPrefix
public java.lang.String getPrefix(java.lang.String namespaceURI)
- Specified by:
getPrefix
in interfacejavax.xml.namespace.NamespaceContext
-
getPrefixes
public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String namespaceURI)
- Specified by:
getPrefixes
in interfacejavax.xml.namespace.NamespaceContext
-
addNamespaceMapping
public void addNamespaceMapping(java.lang.String prefix, java.lang.String namespaceURI)
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.
-
-