Subject: Re: Sort From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 31 Jul 2000 18:19:37 +0200 (MET DST) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Sort, Spychalski, Frank | Thread | RE: Sort, Nate Austin |
Re: easy distinctive sorting?, Rudolf P. Weinmann | Date | Sort supported processors ???, Bill Shaw - EBCX |
Month |