public final class XPathProcessorImpl extends AbstractProcessorImpl implements org.apache.avalon.framework.thread.ThreadSafe
XPathProcessor
component.
To configure it, add the following lines in the
<xpath-processor class="org.apache.cocoon.components.xpath.XPathProcessorImpl"> </xpath-processor>
| Modifier and Type | Class and Description |
|---|---|
private static class |
XPathProcessorImpl.XalanResolver
A Xalan-specific wrapper for the PrefixResolver.
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
m_baseURI |
ROLE| Constructor and Description |
|---|
XPathProcessorImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration) |
boolean |
evaluateAsBoolean(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
Evaluate XPath expression within a context.
|
java.lang.Number |
evaluateAsNumber(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
Evaluate XPath expression within a context.
|
java.lang.String |
evaluateAsString(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
Evaluate XPath expression within a context.
|
org.w3c.dom.NodeList |
selectNodeList(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
Use an XPath string to select a nodelist.
|
org.w3c.dom.Node |
selectSingleNode(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
Use an XPath string to select a single node.
|
evaluateAsBoolean, evaluateAsNumber, evaluateAsString, prefixToNamespace, selectNodeList, selectSingleNodepublic void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfigure in class AbstractProcessorImplorg.apache.avalon.framework.configuration.ConfigurationExceptionpublic boolean evaluateAsBoolean(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
evaluateAsBoolean in interface XPathProcessorevaluateAsBoolean in class AbstractProcessorImplcontextNode - The context node.str - A valid XPath string.resolver - a PrefixResolver, used for resolving namespace prefixespublic java.lang.Number evaluateAsNumber(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
evaluateAsNumber in interface XPathProcessorevaluateAsNumber in class AbstractProcessorImplcontextNode - The context node.str - A valid XPath string.resolver - a PrefixResolver, used for resolving namespace prefixespublic java.lang.String evaluateAsString(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
evaluateAsString in interface XPathProcessorevaluateAsString in class AbstractProcessorImplcontextNode - The context node.str - A valid XPath string.resolver - a PrefixResolver, used for resolving namespace prefixespublic org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
selectSingleNode in interface XPathProcessorselectSingleNode in class AbstractProcessorImplcontextNode - The node to start searching from.str - A valid XPath string.resolver - a PrefixResolver, used for resolving namespace prefixespublic org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
java.lang.String str,
PrefixResolver resolver)
selectNodeList in interface XPathProcessorselectNodeList in class AbstractProcessorImplcontextNode - The node to start searching from.str - A valid XPath string.resolver - a PrefixResolver, used for resolving namespace prefixes