Hi, I need to group values twice based on some attribute and populate it.
below the xml and I want a group-by on UITVOERINGSNIVEAU and Enveloppe
<rows>
<row Enveloppe="ACOS" POST_NUM="1000" UITVOERINGSNIVEAU="BnComd" CSTAMNUMMER="1" />
<row Enveloppe="ACOS" POST_NUM="5000" UITVOERINGSNIVEAU="BnComd" CSTAMNUMMER="2" />
<row Enveloppe="DG" POST_NUM="1001" UITVOERINGSNIVEAU="BdeComd" CSTAMNUMMER="4" />
</rows>
I want the result as below:
<rows>
<row>
<cell image="folder.gif">BnComd</cell>
<row>
<cell image="folder.gif">ACOS</cell>
<row>
<cell>1000</cell>
<cell>1</cell>
</row>
<row>
<cell>5000</cell>
<cell>2</cell>
<row>
</row>
</row>
<row>
<cell image="folder.gif">BdeComd</cell>
<row>
<cell image="folder.gif">DG</cell>
<row>
<cell>1001</cell>
<cell>4</cell>
</row>
</row>
</row>
</rows>
I Find this to do a group-by on only UITVOERINGSNIVEAU, but I don't know how to integrate my second group-by:
<xsl:template match="/*">
<rows>
<xsl:for-each-group select="//rows/row" group-by="@UITVOERINGSNIVEAU">
<row>
<cell image="folder.gif"><xsl:value-of select="current-grouping-key()"/></cell>
<xsl:apply-templates select="current-group()"/>
</row>
</xsl:for-each-group>
</rows>
</xsl:template>
<xsl:template match="row">
<row>
<xsl:apply-templates select="@* except @UITVOERINGSNIVEAU"/>
</row>
</xsl:template>
<xsl:template match="row/@*">
<cell><xsl:value-of select="."/></cell>
</xsl:template>
can someone help me please?
thanks