This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: select="preceding-sibling::ROW[entered_formatted_day=$currentFruit]"is too slow
- To: xsl-list at mulberrytech dot com
- Subject: Re: select="preceding-sibling::ROW[entered_formatted_day=$currentFruit]"is too slow
- From: Thorbjoern Ravn Andersen <ravn at mip dot sdu dot dk>
- Date: Tue, 4 Apr 2000 07:00:25 +0200 (MET DST)
- Reply-To: xsl-list at mulberrytech dot com
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@rogge.co.uk> 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