net.sf.saxon.instruct
public class ForEachGroup extends Instruction implements MappingFunction
Field Summary | |
---|---|
static int | GROUP_ADJACENT |
static int | GROUP_BY |
static int | GROUP_ENDING |
static int | GROUP_STARTING |
Constructor Summary | |
---|---|
ForEachGroup(Expression select, Expression action, byte algorithm, Expression key, Comparator collator, SortKeyDefinition[] sortKeys) |
Method Summary | |
---|---|
void | checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole)
Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type. |
int | computeDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions. |
boolean | createsNewNodes()
Determine whether this instruction creates new nodes.
|
void | display(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure. |
Expression | getActionExpression()
Get the action expression (the content of the for-each) |
int | getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes |
ItemType | getItemType(TypeHierarchy th)
Get the item type of the items returned by evaluating this instruction
|
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Iterator | iterateSubExpressions()
Get all the XPath expressions associated with this instruction
(in XSLT terms, the expression present on attributes of the instruction,
as distinct from the child instructions in a sequence construction) |
Object | map(Item item, XPathContext context)
Map one item to a sequence.
|
Expression | optimize(Optimizer opt, StaticContext env, ItemType contextItemType) |
TailCall | processLeavingTail(XPathContext context) |
protected void | promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
|
Expression | simplify(StaticContext env)
Simplify an expression. |
Expression | typeCheck(StaticContext env, ItemType contextItemType) |
Returns: the depencies, as a bit-mask
Parameters: level indentation level for this expression out
Parameters: th
Returns: the static item type of the instruction
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: XPathException if any dynamic error occurs evaluating the expression
Parameters: item The item to be mapped. If context is supplied, this must be the same as context.currentItem(). context The processing context. This is supplied only for mapping constructs that set the context node, position, and size. Otherwise it is null.
Returns: either (a) a SequenceIterator over the sequence of items that the supplied input item maps to, or (b) an Item if it maps to a single item, or (c) null if it maps to an empty sequence.
Parameters: offer The type of rewrite being offered
Throws: XPathException
Returns: the simplified expression
Throws: XPathException if an error is discovered during expression rewriting