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

Re: template to validate dates?

Subject: Re: template to validate dates?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 10 Apr 2007 09:49:53 +0100
Re:  template to validate dates?
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

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-2007 All Rights Reserved.