users@jaxb.java.net

Re: unmarshalling - turn off validation to prevent unexpected element exception

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 15 Dec 2003 10:26:34 -0800

If you know where those 3rd party elements appear in your XML documents,
you might want to use wildcards in the schema to describe where they can
happen. This will let JAXB handle them properly.

If you can easily filter those elements out, you might consider writing
a SAX XMLFilter or a simple transformation. You can use them as a
pre-processing before the unmarshalling, and in this way the RI won't
see any of those 3rd party elements. If you can use SAX for this, this
can be done quite efficiently. If you use XSLT, this can be done quite
easily.

We are also considering to make the unmarshaller more robust by
recovering from unexpected elements errors.

regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net