com.icl.saxon.expr
Class SingletonExpression
public abstract class SingletonExpression
A node set expression that will always return zero or one nodes
containsReferences , display , enumerate , evaluate , evaluateAsBoolean , evaluateAsNodeSet , evaluateAsNumber , evaluateAsString , getDataType , getDependencies , getStaticContext , indent , isContextDocumentNodeSet , make , outputStringValue , reduce , setStaticContext , simplify , usesCurrent |
enumerate
public NodeEnumeration enumerate(Context context,
boolean sort)
throws XPathException
Evaluate the expression in a given context to return a Node enumeration
- enumerate in interface NodeSetExpression
context
- the evaluation contextsort
- Indicates result must be in document order
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 NodeSetExpression
context
- The context in which the expression is to be evaluated
- true if there are any nodes selected by the NodeSetExpression
evaluateAsNodeSet
public NodeSetValue evaluateAsNodeSet(Context context)
throws XPathException
Evaluate an expression as a NodeSet.
- evaluateAsNodeSet in interface NodeSetExpression
context
- The context in which the expression is to be evaluated
- the value of the expression, evaluated in the current context
evaluateAsString
public String evaluateAsString(Context context)
throws XPathException
Evaluate as a string. Returns the string value of the node if it exists
- evaluateAsString in interface NodeSetExpression
context
- The context in which the expression is to be evaluated
- true if there are any nodes selected by the NodeSetExpression
isContextDocumentNodeSet
public boolean isContextDocumentNodeSet()
Determine, in the case of an expression whose data type is Value.NODESET,
whether all the nodes in the node-set are guaranteed to come from the same
document as the context node. Used for optimization.
- isContextDocumentNodeSet in interface Expression
selectFirst
public NodeInfo selectFirst(Context context)
throws XPathException
Return the first node selected by this Expression when evaluated in the current context
- selectFirst in interface NodeSetExpression
context
- The context for the evaluation
- the NodeInfo of the first node in document order, or null if the node-set
is empty.