Title: Date validation/restriction

Hi Mike,

 

With XML Schema you can define bounds to a dateTime using the maxInclusive(exclusive) and minInclusive(exclusive) facets

and this is supported by Castor.

However it won’t solve your problem, I would advise you to change by hand the generated Object Model by hand to add your logic.

Remember that W3C XML Schema is a language to describe XML instance documents and doesn’t introduce *business* logic (like SchemaTron for instance)

 

Hope that helps,

Arnaud

 

-----Original Message-----
From: Mike Ward [mailto:[EMAIL PROTECTED]]
Sent
:
Thursday, January 10, 2002 12:31 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Date validation/restriction

 

I'm pretty new to castor and schemas so this may be a naive question but here it is anyway :)

Is there a way to validate a dateTime such that it is between a restricted range base on the current date?? 

For example, I would like to validate that a dateTime element is in the range:
        (currentDate-7days)<currentDate<(currentDate+7days)

Is this possible using a schema and does castor support this??

thanks in advance,
-mike

Reply via email to