users@jaxb.java.net

Re: unmarshaller skipping unexpected elements for setValidating( false )

From: jon gold <dev_at_samizdatdigital.org>
Date: Fri, 19 Nov 2004 23:35:31 -0800

thanks. your suspicions are correct (i was just using the
ValidationEventCollector).

jon


Kohsuke Kawaguchi wrote:

> jon gold wrote:
>
>> about this time last year, i think it was mentioned that there was the
>> possibility that the RI's Unmarshaller could be made to handle (skip
>> over) unexpected elements when validation was turned off:
>>
>> https://jaxb.dev.java.net/servlets/ReadMsg?list=users&msgNo=2951
>>
>> unless i'm doing something incorrectly, i don't seem to be getting
>> this behavior (jaxb 1.4 in the jwsdp 1.5). was this feature ever
>> implemented, or are unexpected elements still cause for failure,
>> regardless of validation being disabled.
>
>
> When the unmarshaller sees an unexpected element, it reports the problem
> to the handler. If no user handler is installed, the default handler
> takes the processing, and it just aborts the processing right there.
>
> If you install your own ValidationEventHandler, then you can tell the
> unmarshaller to continue. If you do that, the unmarshaller ignores this
> element and trys to sync up with the next element.
>
> I suspect that you haven't installed your ValidationEventHandler.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net