Grouping Syntax
<xsl:for-each-group
select = expression
group-by = "string expression"
group-adjacent = "string expression"
group-starting-with = pattern>
<!-- Content: (xsl:sort*, content-constructor) -->
</xsl:for-each-group>
-
The
select
attribute selects the population to be grouped. -
The
group-by
attribute calculates a string value for each node in the population. Nodes with the same value are grouped together. -
The
group-adjacent
attribute calculates a string value for each node in the population. Every time the value changes, a new group is started. -
The
group-starting-with
starts a new group every time its pattern is matched. -
group-by
,group-adjacent
, andgroup-starting-with
are mutually exclusive.
Functions:
current-group()
Returns the contents of the current group selected by xsl:for-each-group
current-grouping-key()
Returns the value that is the grouping key of the current group selected by xsl:for-each-group.