com.icl.saxon.expr

Class RootExpression

public class RootExpression extends SingletonExpression

An expression whose value is always a set of nodes containing a single node, the document root.
Method Summary
voiddisplay(int level)
Diagnostic print of expression structure
booleanevaluateAsBoolean(Context context)
Evaluate as a boolean.
StringevaluateAsString(Context context)
Evaluate as a string
intgetDependencies()
Determine which aspects of the context the expression depends on.
NodeInfogetNode(Context context)
Return the first element selected by this Expression
Expressionreduce(int dependencies, Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies on the context.
Expressionsimplify()
Simplify an expression

Method Detail

display

public void display(int level)
Diagnostic print of expression structure

evaluateAsBoolean

public boolean evaluateAsBoolean(Context context)
Evaluate as a boolean.

Parameters: context The context (not used)

Returns: true (always - because the nodeset is never empty)

evaluateAsString

public String evaluateAsString(Context context)
Evaluate as a string

Parameters: context The context for evaluation

Returns: The concatenation of all the character data within the document

getDependencies

public int getDependencies()
Determine which aspects of the context the expression depends on. The result is a bitwise-or'ed value composed from constants such as Context.VARIABLES and Context.CURRENT_NODE

getNode

public NodeInfo getNode(Context context)
Return the first element selected by this Expression

Parameters: context The evaluation context

Returns: the NodeInfo of the first selected element, or null if no element is selected

reduce

public Expression reduce(int dependencies, Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies on the context.

Parameters: dependencies The dependencies to be removed context The context to be used for the partial evaluation

Returns: a new expression that does not have any of the specified dependencies

simplify

public Expression simplify()
Simplify an expression

Returns: the simplified expression