users@jaxb.java.net

Re: xsd:choice and jaxb generated code

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 31 Mar 2005 16:23:20 -0800

Nicolas Pujol wrote:
> Hi,
>
> I was wondering if there was a way (either via schema
> or jaxb ) to handle the case where all the element
> under an xsd:choice are of the same type. I am asking
> this because the code that is currently generated is
> generic and assumes that these elements are of
> different types and consequently has to create
> additional code which is cumbersome to work with if it
> turns out the elements share the same parent type.

Yeah, this kind of optimization would be nice to do.
However, because the actual binding logic is governed by the spec, it's
not possible for the RI to just change it.

With 2.0, I think handling like this has been improved. Have you tried
the technology preview version?


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com