users@jaxb.java.net

Re: Does not throw an validation exception

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 07 May 2003 11:07:09 -0700

I'm sorry, I still haven't gotten time a chance to work on your case,
but I will.


> Is it okay to catch a validation error event and ignore ? e.g. date is
> invalid in XML Schema format... but valid with my conversion methods...
> Since I know it will work with my method (or throw a parse exception, if not
> valid), I ignore the XML schema validation event...

Yes, that would be perfectly OK. Oh, I see, now I see what's happening.
You caught the first error, and ignored it, didn't you. That's why the
validator went into the panic mode and skipped the next error.

Well, in that case, it seems like the behavior is by design.


I think you shouldn't be defining Date_CCYYMMDD type by deriving from
xs:date, for the same reason you shouldn't derive StringTime_HHmmss from
xs:time.


The validity of a document is not affected by JAXB customization. It
doesn't matter whether your converter can handle CCYYMMDD or not; as far
as XML Schema is concerned, 20030507 is not a legal value, and that's
why you shouldn't be using it.



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