Rick Quatro rick(_at_)rickquatro(_dot_)com wrote:
<xsl:template match="Cases">
<xsl:for-each-group select="Story" group-by="Category">
<category><xsl:copy-of
select="current-grouping-key()"/></category>
<xsl:apply-templates select="Case"/>
</xsl:for-each-group>
</xsl:template>
If you use
<xsl:for-each-group select="Story/Category" group-by=".">
<category><xsl:copy-of
select="current-grouping-key()"/></category>
<xsl:apply-templates
select="current-group()/following-sibling::Case[1]"/>
</xsl:for-each-group>
then I think, for your sample, you will get the wanted result. But I am
not sure how you want to relate "Category" and "Case" elements.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--