[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: select="preceding-sibling::ROW[entered_formatted_day=$cu

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)
Re: select="preceding-sibling::ROW[entered_formatted_day=$cu
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.