users@jaxb.java.net

Re: Unexpect Element vs. undefined attribute

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 21 Mar 2003 07:42:00 -0800

> 1. Is there any way to handle a validation event from the unmarshaller,
> which can consume and return "true" on an "unexpected element" ERROR
> such that unmarshalling can continue? I.e. is there any way to cause the
> unmarshaller to just ignore extra elements?

I'd imagine this would be useful, though unfortunately there's no simple
way to do this right now. I suppose any error recovery attempt whoever
poor is better than just dying.

I'll check what we can do for the next release.


> 2. However, it seems that the unmarshaller _does_ ignore undefined
> attributes. Is this a bug? Or is it a feature? Can it be depended on?

I consider that as a feature. Ignoring attributes is just so easy, and
that's why the unmarshaller is made to ignore them, whereas ignoring
elements is not that easy.


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