Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In 2001, the XSL Working Group released a document entitled “XSLT Requirements Version 2.0.” More than half of the document came under the heading “Must Simplify Grouping.” (I can’t imagine how the group would have met a requirement named “Must Make Grouping More Complicated and Confusing.”) We’ll take a look at those changes in this section.
XSLT 2.0’s grouping functions are built around the <xsl:for-each-group> element. Within this element, we’ll use the new XSLT functions current-group( ) and current-grouping-key( ) to work with the data we’re grouping. There are four mutually exclusive attributes for the <xsl:for-each-group> element, each of which performs a different style of grouping: