users@jaxb.java.net

Re: Customaziation and validation

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 10 Apr 2003 15:42:10 -0400

> Woudn't it be valid according to the Schema specs ? The schema defines an
> element as type SimpleType and as the one which has different conversion
> rules ?

The conversion rules are defined by JAXB. So it's not something the XML
Schema spec recognizes. And YYYYMMDD is NOT a valid xs:date value.

It's this simple; your schema says the AccidentDate element will have
the xs:date type. YYYYMMDD is not a valid xs:date value. Therefore
<AccidentDate>20030410</AccidentDate> is not valid wrt your schema.

Just try any XML schema processor out there. They should agree with this.


> So does this mean that if I have validation turned on, then Conversion using
> other methods cannot be done ?

You can. It's just that the meaning of the validation is not affected by
any of the JAXB customization. XML Schema validation is defined purely
on the schema and the instance.



> Just curious, one solution I can think in my situation is to catch that
> event and discard it as if it did not happen...

Would you elaborate what you think a problem is? Because I don't see any
problem.


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com