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

RE: grouping and sorting by date

Subject: RE: [xsl] grouping and sorting by date
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 3 Mar 2004 15:12:33 +0200
sorting by date in sql
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


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.