Re: [xsl] Copy and group XML

Subject: Re: [xsl] Copy and group XML
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 26 Jan 2011 23:40:06 +0000
On 26/01/2011 19:40, Jacobus Reyneke wrote:
Thanks Michael, it fixed one problem but introduced another.


Transformation: <xsl:template match="play"> <xsl:for-each-group select="*" group-adjacent="(@act, '?')[1]"> <xsl:choose> <xsl:when test="@act"> <act> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </act>

In my solution, I did <xsl:apply-templates select="current-group()"/>, which will process the whole group. You have changed it to do <xsl:copy>, which only copies the context item, that is the first item in the group.


Michael Kay
Saxonica

Current Thread