Subject: Re: sort and if
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Wed, 6 Feb 2002 00:40:52 +0100
|
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
| Current Thread |
- sort and if
- Ilyasov Jienbay - Tue, 5 Feb 2002 06:58:08 -0500 (EST)
- yan bai - Tue, 5 Feb 2002 09:37:04 -0500 (EST)
- Andrew Welch - Tue, 5 Feb 2002 10:36:00 -0500 (EST)
- yan bai - Tue, 5 Feb 2002 14:11:31 -0500 (EST)
- Joerg Heinicke - Tue, 5 Feb 2002 18:37:56 -0500 (EST) <=
|
|