Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<mulexml:xslt-transformer name="xslt">
<mulexml:xslt-text>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<table>
<xsl:for-each-group select="cities/city" group-by="@country">
<tr>
<td>
<xsl:value-of select="@country"/>
</td>
<td>
<xsl:value-of select="current-group()/@name" separator=", "/>
</td>
<td>
<xsl:value-of select="sum(current-group()/@pop)"/>
</td>
</tr>
</xsl:for-each-group>
</table>
</xsl:template>
</xsl:stylesheet>
</mulexml:xslt-text>
</mulexml:xslt-transformer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.