com.saxonica.extra
Class ForEachGroupFunction
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
com.saxonica.extra.ForEachGroupFunction
- All Implemented Interfaces:
- Serializable, SourceLocator, EvaluableItem, SequenceIterable, InstructionInfoProvider
public class ForEachGroupFunction
- extends SystemFunction
This class implements the extension function saxon:for-each-group(). This is a higher order
function that provides grouping capability. Its effect is similar to the XSLT 2.0 for-each-group
instruction, but it works also in XQuery. The first argument is the population to be grouped;
the second argument is a function that calculates the grouping key; the third argument is the action
to be performed on each group: it gets the members of the group as its argument.
- See Also:
- Serialized Form
Methods inherited from class net.sf.saxon.functions.SystemFunction |
addDocToPathMap, checkArguments, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, makeSystemFunction, optimize, setDetails |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
addExternalFunctionCallToPathMap, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, toString, typeCheck |
Methods inherited from class net.sf.saxon.expr.Expression |
addToPathMap, adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, display, doPromotion, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, findParentOf, getCardinality, getColumnNumber, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterateEvents, markTailFunctionCalls, process, setContainer, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation |
ForEachGroupFunction
public ForEachGroupFunction()
iterate
public SequenceIterator iterate(XPathContext context)
throws XPathException
- 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.
- Specified by:
iterate
in interface SequenceIterable
- Overrides:
iterate
in class Expression
- 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
Copyright (C) Michael H. Kay. All rights reserved.