org.apache.excalibur.xml.xpath
Interface XPathProcessor

All Known Implementing Classes:
AbstractProcessorImpl, JaxenProcessorImpl, Saxon6ProcessorImpl, Saxon7ProcessorImpl, XPathProcessorImpl

public interface XPathProcessor

This is the interface of the XPath processor.

All methods have two variants: one which takes a PrefixResolver as an extra argument, and one which doesn't. The PrefixResolver interface allows to provide your own namespace prefix resolving.

Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:15 $ $Author: cziegeler $
Author:
Avalon Development Team

Field Summary
static java.lang.String ROLE
          The role implemented by an XSLTProcessor.
 
Method Summary
 boolean evaluateAsBoolean(org.w3c.dom.Node contextNode, java.lang.String str)
          Evaluate XPath expression within a context.
 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)
          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)
          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)
          Use an XPath string to select a nodelist.
 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)
          Use an XPath string to select a single node.
 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.
 

Field Detail

ROLE

public static final java.lang.String ROLE
The role implemented by an XSLTProcessor.

Method Detail

evaluateAsBoolean

public boolean evaluateAsBoolean(org.w3c.dom.Node contextNode,
                                 java.lang.String str)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
Returns:
expression result as boolean.

evaluateAsNumber

public java.lang.Number evaluateAsNumber(org.w3c.dom.Node contextNode,
                                         java.lang.String str)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
Returns:
expression result as number.

evaluateAsString

public java.lang.String evaluateAsString(org.w3c.dom.Node contextNode,
                                         java.lang.String str)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
Returns:
expression result as string.

selectSingleNode

public org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
                                         java.lang.String str)
Use an XPath string to select a single node.

Parameters:
contextNode - The node to start searching from.
str - A valid XPath string.
Returns:
The first node found that matches the XPath, or null.

selectNodeList

public org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
                                           java.lang.String str)
Use an XPath string to select a nodelist.

Parameters:
contextNode - The node to start searching from.
str - A valid XPath string.
Returns:
A List, should never be null.

evaluateAsBoolean

public boolean evaluateAsBoolean(org.w3c.dom.Node contextNode,
                                 java.lang.String str,
                                 PrefixResolver resolver)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
resolver - a PrefixResolver, used for resolving namespace prefixes
Returns:
expression result as boolean.

evaluateAsNumber

public java.lang.Number evaluateAsNumber(org.w3c.dom.Node contextNode,
                                         java.lang.String str,
                                         PrefixResolver resolver)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
resolver - a PrefixResolver, used for resolving namespace prefixes
Returns:
expression result as number.

evaluateAsString

public java.lang.String evaluateAsString(org.w3c.dom.Node contextNode,
                                         java.lang.String str,
                                         PrefixResolver resolver)
Evaluate XPath expression within a context.

Parameters:
contextNode - The context node.
str - A valid XPath string.
resolver - a PrefixResolver, used for resolving namespace prefixes
Returns:
expression result as string.

selectSingleNode

public 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.

Parameters:
contextNode - The node to start searching from.
str - A valid XPath string.
resolver - a PrefixResolver, used for resolving namespace prefixes
Returns:
The first node found that matches the XPath, or null.

selectNodeList

public org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
                                           java.lang.String str,
                                           PrefixResolver resolver)
Use an XPath string to select a nodelist.

Parameters:
contextNode - The node to start searching from.
str - A valid XPath string.
resolver - a PrefixResolver, used for resolving namespace prefixes
Returns:
A List, should never be null.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.