|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sort and if
Just use a grouping technique like Muenchian Method, which was discussed on
this list today in about 20 messages.
The problem with your method is the following:
<xsl:for-each select="item">
<xsl:sort select="date"/>
<xsl:if test="preceding-sibling::item[1][date= current()/date]">
<xsl:value-of select="date"/>
</xsl:if>
</xsl:for-each>
The test on preceding <item> elements sounds very good, but it's using the
document order and not the sorted order.
Regards,
Joerg
----- Original Message -----
From: "Ilyasov Jienbay" <jienbay@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, February 05, 2002 1:00 PM
Subject: sort and if
> hello,
>
> please help with this...
> it drives me crazy!
>
> <items>
> <item>
> <date>011022<date>
> </item>
> <item>
> <date>011021<date>
> </item>
> <item>
> <date>011021<date>
> </item>
> </items>
>
> i want to *sort* and then put "same as above" or *nothing* if the
previouse
> $date is equal to the current $cur_date, something like:
>
> date
> -----
> 011021
> same as above(or nothing)
> 011022
>
> thank you in advance
>
> jian
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








