Interface PrefixResolver
- All Known Implementing Classes:
PrefixResolverDefault
public interface PrefixResolver
The class that implements this interface can resolve prefixes to namespaces. Examples would
include resolving the meaning of a prefix at a particular point in a document, or mapping the
prefixes used in an XPath expression.
-
Method Summary
Modifier and TypeMethodDescriptiongetNamespaceForPrefix
(String prefix) Given a namespace, get the corresponding prefix.getNamespaceForPrefix
(String prefix, Node context) Given a namespace, get the corresponding prefix, based on the context node.boolean
-
Method Details
-
getNamespaceForPrefix
Given a namespace, get the corresponding prefix. This assumes that the PrefixResolver holds its own namespace context, or is a namespace context itself.- Parameters:
prefix
- The prefix to look up, which may be an empty string ("") for the default Namespace.- Returns:
- The associated Namespace URI, or null if the prefix is undeclared in this context.
-
getNamespaceForPrefix
Given a namespace, get the corresponding prefix, based on the context node.- Parameters:
prefix
- The prefix to look up, which may be an empty string ("") for the default Namespace.context
- The node context from which to look up the URI.- Returns:
- The associated Namespace URI as a string, or null if the prefix is undeclared in this context.
-
handlesNullPrefixes
boolean handlesNullPrefixes()
-