org.apache.xpath.jaxp
Class JAXPPrefixResolver
java.lang.Object
org.apache.xpath.jaxp.JAXPPrefixResolver
- PrefixResolver
public class JAXPPrefixResolver
extends java.lang.Object
This class implements a Default PrefixResolver which
can be used to perform prefix-to-namespace lookup
for the XPath object.
This class delegates the resolution to the passed NamespaceContext
S_XMLNAMESPACEURI
public static final String S_XMLNAMESPACEURI
The URI for the XML namespace.
(Duplicate of that found in org.apache.xpath.XPathContext).
JAXPPrefixResolver
public JAXPPrefixResolver(NamespaceContext nsContext)
getNamespaceForPrefix
public String getNamespaceForPrefix(String prefix,
Node namespaceContext)
Given a prefix and a Context Node, get the corresponding namespace.
Warning: This will not work correctly if namespaceContext
is an attribute node.
prefix
- Prefix to resolve.namespaceContext
- Node from which to start searching for a
xmlns attribute that binds a prefix to a namespace.
- Namespace that prefix resolves to, or null if prefix
is not bound.
Copyright B) 2006 Apache XML Project. All Rights Reserved.