[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: "Katie McNally" <kmcnally9@xxxxxxxxxxx>
Date: Mon, 22 Oct 2001 16:27:47 -0500
sorting a table by date
The format of the dates returned in my XML is 17-Dec-2000 07:23:32. I need to display dates as 12/17/00. I am formatting the dates I display by calling the following template:

<xsl:template name="dateTemplate">
<xsl:variable name="months" select="'JanFebMarAprMayJunJulAugSepOctNovDec'"/>
<xsl:variable name="day" select="substring( ., 1, 2 )"/>
<xsl:variable name="earlier_months" select="substring-before( $months, substring( ., 4, 3 ))"/>
<xsl:variable name="month_number" select="string-length( $earlier_months ) div 3 + 1"/>
<xsl:variable name="month" select="format-number( $month_number, '00' )" />
<xsl:variable name="year" select="substring( ., 10, 2 )"/>
<xsl:value-of select="concat( $month, '/', $day, '/', $year )"/>
<xsl:text>&#x0D;&#x0A;</xsl:text>
</xsl:template>


I am displaying the dates in a table. The table can be sorted by the user by clicking on the column titles. I am able to sort the table for all of the non-date columns, but do not know how to sort the table by date.

Any suggestions?

Katie

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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.