[Home] [By Thread] [By Date] [Recent Entries]
On 2012-08-31 17:04, Michael Kay wrote:
Untested solution: should be group-by, of course The complete template might look like this: <xsl:template match="Products">
<xsl:copy>
<xsl:copy-of select="@*, Manager" />
<xsl:for-each-group select="Product" group-by="@id">
<xsl:for-each select="current-group()">
<xsl:sort select="number(rank)" order="descending"/>
<xsl:if test="position() = 1">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:for-each-group>
<xsl:copy-of select="* except (Manager union Product)" />
</xsl:copy>
</xsl:template>
|

Cart



