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

Re: Sort

Subject: Re: Sort
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 31 Jul 2000 18:19:37 +0200 (MET DST)
sort oliver
Hi Jon,

> I have a sorting question for the group. I have elements like the following:
> 
> <Marquee Class="RIO_container" Expiration_day="Indefinite"
> Expiration_month="Indefinite" Expiration_year="Indefinite"
> Id="vt_182-Virtual_teams-Marquee.xml" Last_modifier="admin"
> Maximum_number="" Modification_date="Thursday, July 20, 2000 10:38:21 AM
> PDT" Owner="admin" Progress="complete" Status="modify" Used_in=" vt">
> 
> I want to sort by the Modification_date attribute. How can I do this
> efficiently with XSLT? Or maybe I just can't? I've tried using a JavaScript
> extension to manipulate the numbers but it just didn't seem to work. I'd
> prefer not to do it with Java but with if I have to.

Use multiple <xsl:sort> statements:

<xsl:sort select="substring(
                     substring-after(
                        substring-after(@Modification_date,','),
                        ','),
                     2, 4)" /> <!-- this should select 2000, not tested ... -->
<!-- sort by month, see below -->
<xsl:sort select="substring ..." /> <!-- select day etc. -->

One problem is the month given with its name.
A solution is in the XSL FAQ - look for "arbitrary sorting":
http://www.dpawson.freeserve.co.uk/xsl/N6461.html#N13098
and
http://www.dpawson.freeserve.co.uk/xsl/N6461.html#N13111

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


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


Current Thread
  • Sort
    • Jon Wynacht - Mon, 31 Jul 2000 07:22:27 -0700
      • <Possible follow-ups>
      • Spychalski, Frank - Mon, 31 Jul 2000 18:14:06 +0200
      • Oliver Becker - Mon, 31 Jul 2000 18:19:37 +0200 (MET DST) <=
      • Nate Austin - Mon, 31 Jul 2000 16:26:56 -0500

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.