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

Re: Date compare in XSL

Subject: Re: Date compare in XSL
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 19 Nov 2009 16:53:48 +0000
Re:  Date compare in XSL
2009/11/19 Anil Kumar Veeramalli <anil.v@xxxxxxxxxxxxxxxxxxxxx>:
> Hi ,
>
> I have two variables. I want to find out which is greatest date. I am using
> XSL1.0
>
> <xsl:variable name="date1" select="01-Jan-2008"></xsl:variable>
> <xsl:variable name="date2" select="02-Jan-2009"></xsl:variable>
>
> I could not find any function or documentation to compare the dates.
>
> Please suggest me on this.

In XSLT 1.0, the usual way is to string process the dates into the
form YYYYMMDD, then you can just do straight number comparisons, for
example 20080101 is before 20090102.




-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.