net.sf.saxon.sxpath
public class XPathExpression extends Object
Constructor Summary | |
---|---|
protected | XPathExpression(XPathEvaluator evaluator, Expression exp)
The constructor is protected, to ensure that instances can only be
created using the createExpression() method of XPathEvaluator |
Method Summary | |
---|---|
List | evaluate(Source source)
Execute a prepared XPath expression, returning the results as a List.
|
Object | evaluateSingle(Source source)
Execute a prepared XPath expression, returning the first item in the result.
|
Expression | getInternalExpression()
Low-level method to get the internal Saxon expression object. |
SequenceIterator | rawIterator(Source source)
Get a raw iterator over the results of the expression. |
protected void | setStackFrameMap(SlotManager map)
Define the number of slots needed for local variables within the expression |
Parameters: source the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource.
Returns: The results of the expression, as a List. The List represents the sequence of items returned by the expression. Each item in the list will either be an instance of net.sf.saxon.om.NodeInfo, representing a node, or a Java object representing an atomic value.
Parameters: source the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource.
Returns: The first item in the sequence returned by the expression. If the expression returns an empty sequence, this method returns null. Otherwise, it returns the first item in the result sequence, represented as a Java object using the same mapping as for the evaluate() method
Returns: the underlying Saxon expression object.
Parameters: source the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource.