[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Date expressions in XSLT 1.0


Subject: [xsl] Date expressions in XSLT 1.0
From: Adrien Lazzaro <no_junk_email@xxxxxxx>
Date: Thu, 26 May 2005 20:50:23 -0400

Hello everyone,

I'm fairly new to the world of XSLT and had a few questions regarding date expressions in XSLT 1.0

Is there anyway to do simple date calculations?

For example: Get tomorrow's date by adding 1 to today's date
<xsl:comment>Ideal solution</xsl:comment>
<xsl:variable name="today" select="05/26/2005" />
<xsl:value-of select="$today + 1" /

Given my limited knowledge, it seems that XSLT 1.0 does not support data typing (only strings and numbers). Is there any way to get around this?

Breaking down the date into separate numbers immediately comes to mind. Nevertheless, doing so forces the use of lots of date logic (only 12 months per year, different months have different number of days, etc.) which seems mind-numbing to implement.

I've also found certain extensions (from http://www.exslt.org) that claim to implement such features. Yet, installing such extensions would decrease the portability of the XSLT stylesheets.

Does anyone have any suggestions on which path to take?
I'm also following the 'get Data BETWEEN  FromDate and ToDate' thread.

Thank you for your help,
Adrien

p.s. Not sure which processor I'm using. I'm using XSLT with Filemaker 7 Server Advanced running on a Mac.


Current Thread
Keywords