Package org.apache.xml.utils
Class PrefixResolverDefault
java.lang.Object
org.apache.xml.utils.PrefixResolverDefault
- All Implemented Interfaces:
PrefixResolver
This class implements a generic PrefixResolver that
can be used to perform prefix-to-namespace lookup
for the XPath object.
-
Constructor Summary
ConstructorsConstructorDescriptionPrefixResolverDefault
(Node xpathExpressionContext) Construct a PrefixResolverDefault object. -
Method Summary
Modifier and TypeMethodDescriptionReturn the base identifier.getNamespaceForPrefix
(String prefix) Given a namespace, get the corrisponding prefix.getNamespaceForPrefix
(String prefix, Node namespaceContext) Given a namespace, get the corrisponding prefix.boolean
-
Constructor Details
-
PrefixResolverDefault
Construct a PrefixResolverDefault object.- Parameters:
xpathExpressionContext
- The context from which XPath expression prefixes will be resolved. Warning: This will not work correctly if xpathExpressionContext is an attribute node.
-
-
Method Details
-
getNamespaceForPrefix
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.- Specified by:
getNamespaceForPrefix
in interfacePrefixResolver
- Parameters:
prefix
- Prefix to resolve.- Returns:
- Namespace that prefix resolves to, or null if prefix is not bound.
-
getNamespaceForPrefix
Given a namespace, get the corrisponding prefix. Warning: This will not work correctly if namespaceContext is an attribute node.- Specified by:
getNamespaceForPrefix
in interfacePrefixResolver
- Parameters:
prefix
- Prefix to resolve.namespaceContext
- Node from which to start searching for a xmlns attribute that binds a prefix to a namespace.- Returns:
- Namespace that prefix resolves to, or null if prefix is not bound.
-
getBaseIdentifier
Return the base identifier.- Specified by:
getBaseIdentifier
in interfacePrefixResolver
- Returns:
- null
-
handlesNullPrefixes
public boolean handlesNullPrefixes()- Specified by:
handlesNullPrefixes
in interfacePrefixResolver
- See Also:
-