[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] grouping and sorting by date


Subject: RE: [xsl] grouping and sorting by date
From: Nathan Shaw <n8_shaw@xxxxxxxxx>
Date: Wed, 3 Mar 2004 07:29:20 -0800 (PST)

Thanks Jarno. I did not see your earlier reply, sorry.
I figured that I either did not include enough details
or that my post was simply lost in the chop.

One question for you... could this be accomplished
using template matching instead of for-each loops?

Thanks for your help. This should at least get me
started and heading in the right direction!

--Nathan


--- Jarno.Elovirta@xxxxxxxxx wrote:
> Hi,
> 
> > I am trying to group and sort by date in an xslt I
> am
> > working on going from xml to html. Specifically, I
> am
> > trying to sort by year, month and then day on an
> > event's start date. It appears that I may need to
> use
> > keys and a sorting method to do this. I have
> looked
> > through the FAQs and other tutorials, but I am
> having
> > trouble grokking it. Can someone lend some help?
> 
> Didn't I or someone else here already reply to you
> about the sorting? Could you elaborate on exactly
> what do you have problems with? First declare the
> key to be used in the Muechian grouping
> 
>   <xsl:key name="group" match="xcal:vevent"
> use="substring-before(xcal:dtstart, ' ')"/>
> 
> then group and sort with
> 
>   â?¦
>   <!-- process groups -->
>   <xsl:for-each select="xcal:vevent[generate-id(.) =
> generate-id(key('group',
> substring-before(xcal:dtstart, ' ')))]">
>     <xsl:sort
> select="translate(substring-before(xcal:dtstart, '
> '), '-', '')" data-type="number" />
>     <!-- process group members -->
>     <xsl:for-each select="key('group',
> substring-before(xcal:dtstart, ' '))">
>       â?¦
>     </xsl:for-each>
>   </xsl:for-each>
>   â?¦
> 
> Cheers,
> 
> Jarno - Chris C: Vengeance Is Mine
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords