Subject: Re: [xsl] Help me to select group based on maximum value From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Fri, 31 Aug 2012 17:34:04 +0200 |
Untested solution:
<xsl:for-each-group select="Product" group-adjacent="@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: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>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Help me to select group b, Michael Kay | Thread | [xsl] How do I search ancestors in , Costello, Roger L. |
Re: [xsl] Help me to select group b, Michael Kay | Date | Re: [xsl] Replace content of elemen, Wendell Piez |
Month |