Class NodeSetExpression
java.lang.Object
com.icl.saxon.expr.Expression
com.icl.saxon.expr.NodeSetExpression
- Direct Known Subclasses:
AxisExpression, FilterExpression, NodeListExpression, PathExpression, SingletonExpression, SortedSelection, UnionExpression
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
This is an abstract class, the methods are defaults which may be overridden in subclasses
-
Field Summary
Fields inherited from class Expression
staticContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract NodeEnumerationReturn a node enumeration.Evaluate this node-set.booleanevaluateAsBoolean(Context context) Evaluate as a boolean.evaluateAsNodeSet(Context context) Evaluate an expression as a NodeSet.evaluateAsString(Context context) Evaluate as a string.intDetermine the data type of the exprssion, if possiblevoidoutputStringValue(Outputter out, Context context) Evaluate an expression as a String and write the result to the specified outputter.selectFirst(Context context) Return the first node selected by this Expression when evaluated in the current contextMethods inherited from class Expression
containsReferences, display, evaluateAsNumber, getDependencies, getStaticContext, indent, isContextDocumentNodeSet, make, reduce, setStaticContext, simplify, usesCurrent
-
Constructor Details
-
NodeSetExpression
public NodeSetExpression()
-
-
Method Details
-
enumerate
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).- Overrides:
enumeratein classExpression- Parameters:
context- The evaluation contextsorted- True if the nodes must be returned in document order- Throws:
XPathException- when the expression does not return a nodeset.
-
evaluate
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.- Specified by:
evaluatein classExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- the value of the expression, evaluated in the current context
- Throws:
XPathException
-
selectFirst
Return the first node selected by this Expression when evaluated in the current context- Parameters:
context- The context for the evaluation- Returns:
- the NodeInfo of the first node in document order, or null if the node-set is empty.
- Throws:
XPathException
-
evaluateAsString
Evaluate as a string. Returns the string value of the first node selected by the NodeSetExpression- Overrides:
evaluateAsStringin classExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- the value of the NodeSetExpression, evaluated in the current context
- Throws:
XPathException
-
outputStringValue
Evaluate an expression as a String and write the result to the specified outputter.- Overrides:
outputStringValuein classExpression- Parameters:
out- The required outputtercontext- The context in which the expression is to be evaluated- Throws:
TransformerException
-
evaluateAsBoolean
Evaluate as a boolean. Returns true if there are any nodes selected by the NodeSetExpression- Overrides:
evaluateAsBooleanin classExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- true if there are any nodes selected by the NodeSetExpression
- Throws:
XPathException
-
evaluateAsNodeSet
Evaluate an expression as a NodeSet.- Overrides:
evaluateAsNodeSetin classExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- the value of the expression, evaluated in the current context
- Throws:
XPathException- when the expression does not return a nodeset.
-
getDataType
public int getDataType()Determine the data type of the exprssion, if possible- Specified by:
getDataTypein classExpression- Returns:
- Value.NODESET
-