You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Antonio Menchero Fernández <am...@aqs.es> on 2000/06/22 13:18:07 UTC

No validation performed with recurringDuration and its derived types

I cannot get validation of recurringDuration and its derived types 
(timeInstant, date) work. In fact, no validation is performed.

Checking RecurringDurationDatatypeValidator validate() method, it seems a 
pattern is expected to check validity using a RegularExpression object. But 
in DatatypeFactoryImpl initializeRegistry(), when 
RecurringDurationDatatypeValidator is associated with 'recurringDuration' 
type (or derived types) no pattern is passed along. Perhaps it could be 
done as with 'language' type in the same method, passing a hashtable with 
ELT_PATTERN key and the corresponding pattern. A possible work around is 
defining a xsd:pattern facet in the schema for the attribute, but though a 
pattern could be defined, what about checking e.g. that a valid number of 
days for a month has been defined or other more complex questions with dates?.

I have a method to instantiate an object of the corresponding class given 
an attribute xml type and its value (of course value as a string) and  it's 
a matter of convenience that RecurringDurationDatatypeValidator validation 
mechanism and DateFormat parsing are in some sense synchronized.

I see some commented code that invokes normalizeInstant() which in turn 
builds a Calendar. I'm just wondering if DateFormat (SimpleDateFormat) 
parsing capabilities could have been used directly to implement 
RecurringDurationDatatypeValidator instead of
regular expressions.

Looking forward your comments. Thanks.

Antonio

[Working with last Xerces release in CVS.]


Re: No validation performed with recurringDuration and its derivedtypes

Posted by Andy Clark <an...@apache.org>.
Antonio Menchero Fernández wrote:
> I cannot get validation of recurringDuration and its derived types
> (timeInstant, date) work. In fact, no validation is performed.

The documentation for Schema states that Date/time is not
currently supported. It is a work in progress.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org