Re: [xsl] template to validate dates?

Subject: Re: [xsl] template to validate dates?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 10 Apr 2007 09:49:53 +0100
On 4/9/07, Glen Mazza <grm7793@xxxxxxxxx> wrote:
Hello,

I have a requirement to convert dates from one format
to another.  There is additional complexity though: if
the date is invalid (say, March 42, 2007 or June 5,
20a02) to just return the invalid date.  (We are
taking the data and loading it into Oracle, if the
date format is invalid it will raise a database error
and we will handle it there.)

A date conversion template is not a problem--I've done
that multiple times in the past, but what is new for
me is trying to validate a date using XSLT functions.
Does anyone know of an available template somewhere on
the 'Net that will do such validation?

I'm not too sure what you are trying to achieve there, but if you want to check if a date is valid then you could use "castable as" eg,

"'2007-04-30' castable as xs:date" returns true

"'2007-04-31' castable as xs:date" returns false

cheers
andrew

Current Thread