com.icl.saxon.expr
Class NodeSetExpression
public abstract class NodeSetExpression
A NodeSetExpression is any expression denoting a set of nodes.
This is an abstract class, the methods are defaults which may be overridden in subclasses
containsReferences , display , enumerate , evaluate , evaluateAsBoolean , evaluateAsNodeSet , evaluateAsNumber , evaluateAsString , getDataType , getDependencies , getStaticContext , indent , isContextDocumentNodeSet , make , outputStringValue , reduce , setStaticContext , simplify , usesCurrent |
enumerate
public abstract NodeEnumeration enumerate(Context context,
boolean sorted)
throws XPathException
Return a node enumeration. All NodeSetExpressions must implement this method:
the evaluate() function is defined in terms of it. (But note that some expressions
that return node-sets are not NodeSetExpressions: for example functions such as
key(), id(), and document() are not, and neither are variable references).
- enumerate in interface Expression
context
- The evaluation contextsorted
- True if the nodes must be returned in document order
evaluate
public Value evaluate(Context context)
throws XPathException
Evaluate this node-set. This doesn't actually retrieve all the nodes: it returns a wrapper
around a node-set expression in which all context dependencies have been eliminated.
- evaluate in interface Expression
evaluateAsBoolean
public boolean evaluateAsBoolean(Context context)
throws XPathException
Evaluate as a boolean. Returns true if there are any nodes
selected by the NodeSetExpression
- evaluateAsBoolean in interface Expression
context
- The context in which the expression is to be evaluated
- true if there are any nodes selected by the NodeSetExpression
evaluateAsString
public String evaluateAsString(Context context)
throws XPathException
Evaluate as a string. Returns the string value of the first node
selected by the NodeSetExpression
- evaluateAsString in interface Expression
context
- The context in which the expression is to be evaluated
- the value of the NodeSetExpression, evaluated in the current context
getDataType
public int getDataType()
Determine the data type of the exprssion, if possible
- getDataType in interface Expression
outputStringValue
public void outputStringValue(Outputter out,
Context context)
throws TransformerException
Evaluate an expression as a String and write the result to the
specified outputter.
- outputStringValue in interface Expression
context
- The context in which the expression is to be evaluated
selectFirst
public NodeInfo selectFirst(Context context)
throws XPathException
Return the first node selected by this Expression when evaluated
in the current context
context
- The context for the evaluation
- the NodeInfo of the first node in document order, or null if the node-set
is empty.