org.apache.xml.utils
Class PrefixResolverDefault
java.lang.Object
org.apache.xml.utils.PrefixResolverDefault
- PrefixResolver
public class PrefixResolverDefault
extends java.lang.Object
This class implements a generic PrefixResolver that
can be used to perform prefix-to-namespace lookup
for the XPath object.
PrefixResolverDefault
public PrefixResolverDefault(Node xpathExpressionContext)
Construct a PrefixResolverDefault object.
xpathExpressionContext
- The context from
which XPath expression prefixes will be resolved.
Warning: This will not work correctly if xpathExpressionContext
is an attribute node.
getNamespaceForPrefix
public String getNamespaceForPrefix(String prefix)
Given a namespace, get the corrisponding prefix. This assumes that
the PrevixResolver hold's it's own namespace context, or is a namespace
context itself.
- getNamespaceForPrefix in interface PrefixResolver
prefix
- Prefix to resolve.
- Namespace that prefix resolves to, or null if prefix
is not bound.
getNamespaceForPrefix
public String getNamespaceForPrefix(String prefix,
Node namespaceContext)
Given a namespace, get the corrisponding prefix.
Warning: This will not work correctly if namespaceContext
is an attribute node.
- getNamespaceForPrefix in interface PrefixResolver
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) 2004 Apache XML Project. All Rights Reserved.