net.sf.saxon.s9api

Class XPathExecutable


public class XPathExecutable
extends java.lang.Object

An XPathExecutable represents the compiled form of an XPath expression. To evaluate the expression, it must first be loaded to form an XPathSelector.

An XPathExecutable is immutable, and therefore thread-safe. It is simplest to load a new XPathSelector each time the expression is to be evaluated. However, the XPathSelector is serially reusable within a single thread.

An XPathExecutable is created by using the XPathCompiler.compile(String) method on the XPathCompiler class.

Constructor Summary

XPathExecutable(XPathExpression exp, Configuration config, IndependentContext env, ArrayList declaredVariables)

Method Summary

XPathExpression
getUnderlyingExpression()
Get the underlying implementation object representing the compiled XPath expression.
StaticContext
getUnderlyingStaticContext()
Get the underlying implementation object representing the static context of the compiled XPath expression.
XPathSelector
load()
Load the compiled XPath expression to prepare it for execution.

Constructor Details

XPathExecutable

protected XPathExecutable(XPathExpression exp,
                          Configuration config,
                          IndependentContext env,
                          ArrayList declaredVariables)

Method Details

getUnderlyingExpression

public XPathExpression getUnderlyingExpression()
Get the underlying implementation object representing the compiled XPath expression. This method provides access to lower-level Saxon classes and methods which may be subject to change from one release to the next.
Returns:
the underlying compiled XPath expression.

getUnderlyingStaticContext

public StaticContext getUnderlyingStaticContext()
Get the underlying implementation object representing the static context of the compiled XPath expression. This method provides access to lower-level Saxon classes and methods which may be subject to change from one release to the next.
Returns:
the underlying static context.

load

public XPathSelector load()
Load the compiled XPath expression to prepare it for execution.
Returns:
An XPathSelector. The returned XPathSelector can be used to set up the dynamic context, and then to evaluate the expression.