Vallamshettla, Anand wrote:
>
>
> We are facing problem unmarshalling a XML file where one required attribute is
> missing even with validation turned off. (Using jwsdp1.5)
>
>
>
> We are getting error messages "Unexpected element". I debugged the generated
> code and found that it is looking for a required attribute and it didn't find in
> XML; that’s the reason it starts throwing all those unexpected elements messages
> i.e using the Discard handler.
>
> If there is and element or attribute that is required and JAXB couldn’t find it,
> then it stops processing one way the other and ends up trashing the file.
We've already fixed this problem for JAXB RI 2.0, but I'm afraid there's
no plan to back port this to 1.0.x.
> Even though JAXB is much 4 times faster than XMLBeans, this may be a huge
> problem with JAXB for customers like us.
We've been measuring the performance of 2.0 carefully, and JAXB RI 2.0
works faster than JAXB RI 1.0.
> PS: When I turn on validation, we run into StackOverFlow exception - tried all
> sorts of memory settings - no luck. It's a huge schema though.
We've been also watching this problem with 2.0 carefully. One of our
test cases is to compile the e-file schema that IRS uses, which weighs
at 6MB, this schema compiles fine, and the generated classes load and
successfully round-trip 1.5MB instance document without any -Xmx nor -Xss.
Once again, I'm afraid we aren't planning to back-port any of those to
1.0.x codebase.
I'm not sure if it would meet your time frame, but if you are interested
in trying JAXB RI 2.0, you can access the technology preview from [1].
[1]
https://jaxb.dev.java.net/ri20-ea.html
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com