| java.lang.Object net.sf.saxon.expr.ComputedExpression net.sf.saxon.instruct.Instruction net.sf.saxon.instruct.ForEachGroup
ForEachGroup | public class ForEachGroup extends Instruction implements MappingFunction(Code) | | Handler for xsl:for-each-group elements in stylesheet. This is a new instruction
defined in XSLT 2.0
|
Method Summary | |
public 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. | public int | computeDependencies() Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions. | final public boolean | createsNewNodes() Determine whether this instruction creates new nodes. | public void | display(int level, NamePool pool, PrintStream out) Diagnostic print of expression structure. | public Expression | getActionExpression() | public int | getInstructionNameCode() | public ItemType | getItemType(TypeHierarchy th) | public SequenceIterator | iterate(XPathContext context) Return an Iterator to iterate over the values of a sequence. | public Iterator | iterateSubExpressions() | public Object | map(Item item, XPathContext context) Map one item to a sequence.
Parameters: item - The item to be mapped.If context is supplied, this must be the same as context.currentItem(). Parameters: context - The processing context. | public Expression | optimize(Optimizer opt, StaticContext env, ItemType contextItemType) | public TailCall | processLeavingTail(XPathContext context) | protected void | promoteInst(PromotionOffer offer) Handle promotion offers, that is, non-local tree rewrites. | public Expression | simplify(StaticContext env) Simplify an expression. | public Expression | typeCheck(StaticContext env, ItemType contextItemType) |
GROUP_ADJACENT | final public static int GROUP_ADJACENT(Code) | | |
GROUP_BY | final public static int GROUP_BY(Code) | | |
GROUP_ENDING | final public static int GROUP_ENDING(Code) | | |
GROUP_STARTING | final public static int GROUP_STARTING(Code) | | |
checkPermittedContents | public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code) | | Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type. It's always OK to say yes, since the check will be
repeated at run-time. The process of checking element and attribute constructors against the content
model of a complex type also registers the type of content expected of those constructors, so the
static validation can continue recursively.
|
computeDependencies | public int computeDependencies()(Code) | | Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions. (This is overridden for path expressions
and filter expressions, where the dependencies of a subexpression are not all
propogated). This method should be called only once, to compute the dependencies;
after that, getDependencies should be used.
the depencies, as a bit-mask |
createsNewNodes | final public boolean createsNewNodes()(Code) | | Determine whether this instruction creates new nodes.
This implementation returns true if the "action" creates new nodes.
(Nodes created by the condition can't contribute to the result).
|
display | public void display(int level, NamePool pool, PrintStream out)(Code) | | Diagnostic print of expression structure. The expression is written to the System.err
output stream
Parameters: level - indentation level for this expression Parameters: out - |
getActionExpression | public Expression getActionExpression()(Code) | | Get the action expression (the content of the for-each)
|
getInstructionNameCode | public int getInstructionNameCode()(Code) | | Get the name of this instruction for diagnostic and tracing purposes
|
getItemType | public ItemType getItemType(TypeHierarchy th)(Code) | | Get the item type of the items returned by evaluating this instruction
the static item type of the instruction Parameters: th - |
iterate | public SequenceIterator iterate(XPathContext context) throws XPathException(Code) | | Return an Iterator to iterate over the values of a sequence. The value of every
expression can be regarded as a sequence, so this method is supported for all
expressions. This default implementation relies on the process() method: it
"pushes" the results of the instruction to a sequence in memory, and then
iterates over this in-memory sequence.
In principle instructions should implement a pipelined iterate() method that
avoids the overhead of intermediate storage.
Parameters: context - supplies the context for evaluation a SequenceIterator that can be used to iterate over the resultof the expression throws: XPathException - if any dynamic error occurs evaluating theexpression |
iterateSubExpressions | public Iterator iterateSubExpressions()(Code) | | 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)
|
map | public Object map(Item item, XPathContext context) throws XPathException(Code) | | Map one item to a sequence.
Parameters: item - The item to be mapped.If context is supplied, this must be the same as context.currentItem(). Parameters: context - The processing context. This is supplied only for mapping constructs thatset the context node, position, and size. Otherwise it is null. either (a) a SequenceIterator over the sequence of items that the supplied inputitem maps to, or (b) an Item if it maps to a single item, or (c) null if it maps to an emptysequence. |
simplify | public Expression simplify(StaticContext env) throws XPathException(Code) | | Simplify an expression. This performs any static optimization (by rewriting the expression
as a different expression).
the simplified expression throws: XPathException - if an error is discovered during expressionrewriting |
|
|