org.apache.excalibur.xml.xpath
Interface XPathProcessor

All Known Implementing Classes:
AbstractProcessorImpl, JaxenProcessorImpl, Saxon8ProcessorImpl, 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 String ROLE
          The role implemented by an XSLTProcessor.
 
Method Summary
 boolean evaluateAsBoolean(org.w3c.dom.Node contextNode, String str)
          Evaluate XPath expression within a context.
 boolean evaluateAsBoolean(org.w3c.dom.Node contextNode, String str, PrefixResolver resolver)
          Evaluate XPath expression within a context.
 Number evaluateAsNumber(org.w3c.dom.Node contextNode, String str)
          Evaluate XPath expression within a context.
 Number evaluateAsNumber(org.w3c.dom.Node contextNode, String str, PrefixResolver resolver)
          Evaluate XPath expression within a context.
 String evaluateAsString(org.w3c.dom.Node contextNode, String str)
          Evaluate XPath expression within a context.
 String evaluateAsString(org.w3c.dom.Node contextNode, String str, PrefixResolver resolver)
          Evaluate XPath expression within a context.
 org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode, String str)
          Use an XPath string to select a nodelist.
 org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode, String str, PrefixResolver resolver)
          Use an XPath string to select a nodelist.
 org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode, String str)
          Use an XPath string to select a single node.
 org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode, String str, PrefixResolver resolver)
          Use an XPath string to select a single node.
 

Field Detail

ROLE

static final String ROLE
The role implemented by an XSLTProcessor.

Method Detail

evaluateAsBoolean

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

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

evaluateAsNumber

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

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

evaluateAsString

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

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

selectSingleNode

org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
                                  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

org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
                                    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

boolean evaluateAsBoolean(org.w3c.dom.Node contextNode,
                          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

Number evaluateAsNumber(org.w3c.dom.Node contextNode,
                        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

String evaluateAsString(org.w3c.dom.Node contextNode,
                        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

org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
                                  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

org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
                                    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-2012 Apache Software Foundation. All Rights Reserved.