Re: select="preceding-sibling::ROW[entered_formatted_day=$currentFruit]" is too slow

Subject: Re: select="preceding-sibling::ROW[entered_formatted_day=$currentFruit]" is too slow
From: Thorbjoern Ravn Andersen <ravn@xxxxxxxxxx>
Date: Tue, 4 Apr 2000 07:00:25 +0200 (MET DST)
On Sun, 2 Apr 2000, Thorbjoern Ravn Andersen wrote:

> Which I would like rendered as
> 
> <h2>2000-04-02</h2>
>     A stuff
>     B stuff
> <h2>2000-04-01</h2>
>     C stuff

With the help of Richard Bell <RichardBell@xxxxxxxxxxx> I ended up with
the following code which does exactly what I wanted.  Your help is much
appreciated.  Thanks!

<xsl:variable name="pos" select="position()-1"/>
<xsl:choose>
<xsl:when test="parent::*/*[position()=$pos]/entered_formatted_day =
entered_formatted_day"/>
<xsl:otherwise>
<h2><xsl:value-of select="entered_formatted_day"/></h2>
</xsl:otherwise>
</xsl:choose>

(The choose was neccesary to get the logic right for the first entry).

-- 
  Thorbjørn Ravn Andersen               "...plus...Tubular Bells!"
  http://www.mip.sdu.dk/~ravn


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


Current Thread