Re: [xsl] Re: Re: Using XSL for a "world records" table

Subject: Re: [xsl] Re: Re: Using XSL for a "world records" table
From: Ryan Heise <rheise@xxxxxxxxxxxxx>
Date: Sun, 18 May 2003 19:01:13 +1000
On Sun, May 18, 2003 at 10:35:18AM +0200, Dimitre Novatchev wrote:

>          <xsl:value-of select="position() + count(/*/record[time &lt;
> current()/time])"/>

This looks nifty. If you just use the count() idea, keys are not

<xsl:for-each select="record">
 <xsl:sort data-type="number" select="time"/>
 <xsl:apply-templates select=".">
  <xsl:with-param name="place" select="1 + count(/*/record[time &lt; current()/time])"/>

I also just figured out another approach that just uses keys and not

<xsl:for-each select="record">
 <xsl:if test="not(preceding-sibling::record/time = time)">
  <xsl:apply-templates select="key('records-by-time', time)">
   <xsl:with-param name="place" select="position()"/>

I don't know which way is best, though. I guess whichever way runs the
fastest :-)



 XSL-List info and archive:

Current Thread