Package net.sf.saxon.s9api
Class XPathExecutable
java.lang.Object
net.sf.saxon.s9api.XPathExecutable
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(java.lang.String)
method
on the XPathCompiler
class.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
XPathExecutable
(XPathExpression exp, Processor processor, IndependentContext env, ArrayList<XPathVariable> declaredVariables) -
Method Summary
Modifier and TypeMethodDescriptionGet the statically-determined cardinality of the result of the expression.Get the ItemType of the items in the result of the expression, as determined by static analysis.Get the underlying implementation object representing the compiled XPath expression.Get the underlying implementation object representing the static context of the compiled XPath expression.load()
Load the compiled XPath expression to prepare it for execution.
-
Constructor Details
-
XPathExecutable
protected XPathExecutable(XPathExpression exp, Processor processor, IndependentContext env, ArrayList<XPathVariable> declaredVariables)
-
-
Method Details
-
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.
-
getResultItemType
Get the ItemType of the items in the result of the expression, as determined by static analysis. This is the most precise ItemType that the processor is able to determine from static examination of the expression; the actual items in the expression result are guaranteed to belong to this ItemType or to a subtype of this ItemType.- Returns:
- the statically-determined ItemType of the result of the expression
- Since:
- 9.1
-
getResultCardinality
Get the statically-determined cardinality of the result of the expression. This is the most precise cardinality that the processor is able to determine from static examination of the expression.- Returns:
- the statically-determined cardinality of the result of the expression
- Since:
- 9.1
-
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
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.
-