Re: [xsl] Date compare in XSL

Subject: Re: [xsl] Date compare in XSL
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 19 Nov 2009 16:53:48 +0000
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