net.sf.saxon.functions

Class Remove

public class Remove extends SystemFunction

The XPath 2.0 remove() function
Nested Class Summary
static classRemove.RemoveIterator
An implementation of SequenceIterator that returns all items except the one at a specified position.
Method Summary
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items in the sequence
SequenceIteratoriterate(XPathContext context)
Evaluate the function to return an iteration of selected nodes.
Expressionoptimize(ExpressionVisitor visitor, ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
Expressionsimplify(ExpressionVisitor visitor)
Simplify.

Method Detail

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the items in the sequence

Parameters: th the type hierarchy cache

Returns: the type of the input sequence

iterate

public SequenceIterator iterate(XPathContext context)
Evaluate the function to return an iteration of selected nodes.

optimize

public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.

This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.

Parameters: visitor an expression visitor contextItemType the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to ITEM_TYPE

Returns: the original expression, rewritten if appropriate to optimize execution

Throws: net.sf.saxon.trans.XPathException if an error is discovered during this phase (typically a type error)

simplify

public Expression simplify(ExpressionVisitor visitor)
Simplify. Recognize remove(seq, 1) as a TailExpression.

Parameters: visitor an expression visitor