users@jaxb.java.net

Re: Does not throw an validation exception

From: Sriram Thyagarajan <Sriram_Thyagarajan_at_KEANE-NNE.com>
Date: Wed, 07 May 2003 15:29:56 -0400

>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.

Is this what the ValidationEventCollector do ? collect all events and make
it available for further processing(where it can be processed as needed) ?

Also why would an error on one element affect the next one ?



-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Wednesday, May 07, 2003 2:07 PM
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: Re: Does not throw an validation exception


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