Subject: Re: tokenize(), grouping problem
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Fri, 22 Apr 2005 18:23:35 -0400
|
On 4/22/05, Jon Crump <jjcrump@xxxxxxxxxxxxxxxx> wrote:
> I can use tokenize() to split the strings at the semicolon, but how can I
> then use the result in a for-each-group group-by procedure to output the
> unique values?
I've still not managed to work out my grouping problem, but this is at
least most a solution for your's:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="data">
<data>
<xsl:for-each-group select="record/subjects"
group-by="tokenize(., '; ')">
<subject>
<xsl:value-of select="current-grouping-key()"/>
</subject>
</xsl:for-each-group>
</data>
</xsl:template>
</xsl:stylesheet>
Bruce
|