xsl-list
[Top] [All Lists]

RE: grouping by unique...

2003-06-18 13:02:33
You're right. It's getting slower that it was. THanks for the tip!

-----Original Message-----
From: Lars Huttar [mailto:lars_huttar(_at_)sil(_dot_)org]
Sent: Wednesday, June 18, 2003 3:35 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] grouping by unique...


[I wrote]
I think what you really want to do is apply templates
to <solution>s instead of <item>s, and modify your select=
like this:

    <xsl:if test="generate-id(..) = 
generate-id(key('solution-key', .)[1])">

P.S.
Since you're looking at a "large amount of nodes", I wouldn't
use apply-templates at all; just combine the select and the
if test into a for-each:

  <xsl:template match="report">
    <!-- using Muenchian technique to display a list of unique solutions -->
    <xsl:for-each select="item/metadata/solution[generate-id(..) =
                          generate-id(key('solution-key', .)[1])]">
      <xsl:sort select="." />
      <xsl:value-of select="." />
    </xsl:for-each>       
  </xsl:template>
  
That might make things faster.

Lars


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>