users@jaxb.java.net

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

From: Jouhal, CJ <cjouhal_at_half.com>
Date: Mon, 15 Dec 2003 13:33:12 -0500

Yes I do know where the elements will appear.

How do I specify wildcards in my Schema?


Thanx,
CJ




-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Monday, December 15, 2003 1:27 PM
To: users_at_jaxb.dev.java.net
Subject: Re: unmarshalling - turn off validation to prevent unexpected
element exception



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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net