users@jaxb.java.net

Re: "Easy" unmarshalling an JAXB1

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Sun, 26 Feb 2006 10:26:26 +0100

Hi.

> Wasn't it enough to relax your schema -to allow the non-so correct xml
> documents and generate the classes again?

Relaxing the schema was not an option, since documents are still checked
for validity on demand. What I needed was to import the documents,
invalid marked as invalid, not rejected.

> Or to attach a ValidationEventHandler to the unmarshaller ?
>
> I turn off validation and use a ValidationEventHandler to avoid
> stopping the unmarshalling when a document contains new attributes or
> duplicate elements when I only expect one.

Hm, failed for me. I've tried setting the event handler always returning
"true", but unmarshaller still aborted on invalid data. Not on the first
missing element, but still, I couldn't parse my data. As for excessful
elements - yes, the trick works, but seems like missing data is a bigger
problem.

Bye.
/lexi