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

Re: Sorting by date

Subject: Re: Sorting by date
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Tue, 27 May 2008 17:58:43 +0200
Re:  Sorting by date
sudheshna iyer schrieb:
      <SortDate>Wed, 18 Feb 2008 11:18:41

I need to sort by date(SortDate)

Fix your data to include a nicely sortable date representation like the ISO datetime, or a UNIX timestamp, or even the W3C datetime.

and prepare a html file which outputs the following:

SortDate (yyyy-mm-dd format)
title: modelDate

Eg Output:
2008-02-19 ==> notice that Feb 19 item is displayed
item 2

In XSLT 1.0, which doesn't have a comprehensive date library and which you're maybe restricted to, I'd invoke the transformation from Perl or Java or whatever, and use the host language library to do the date formatting work via strftime and company. This is not a pure XSLT solution and may be called cheating, but it works.

In XSLT 2.0, which I don't know much about, there are a lot of functions
for date, time and even duration manipulation, but I wonder if there is
anything as cool as strftime?

    FunctX XQuery Functions: Dates, Times and Durations


Current Thread


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.
First Name
Last Name
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.