Skip to content

Instantly share code, notes, and snippets.

@marianogonzalez
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogonzalez/97bc262fc04dcd722cf1 to your computer and use it in GitHub Desktop.
Save marianogonzalez/97bc262fc04dcd722cf1 to your computer and use it in GitHub Desktop.
<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