This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]