1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:variable name="tags">
<xsl:for-each select="posts/post">
<xsl:for-each select="tokenize(@tag,' ')">
<tag><xsl:value-of select="."/></tag>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:for-each-group select="$tags/tag" group-by=".">
<xsl:value-of select="current-group()[1]"/>
<xsl:text>/</xsl:text>
</xsl:for-each-group>
</xsl:template>
</xsl:stylesheet> |
Partager