Actually I mistated the problem a bit, it turned out that it occurs when the names of both elements inside choice are the same so the example should be: > > <xsd:choice> > > <xsd:element name="n3" type="t3" /> > > <xsd:element name="n3" type="t4" /> > > </xsd:choice>
when the names are different the problem doesn't occur (normal class fields are generated) so it may be a solution at the same time dkulp wrote: > > > This needs to be asked on the jaxb list. (jaxb.dev.java.net) This code > generation is per jaxb default spec, but there may be an xjc plugin or > something that simplifies this. > > Dan > > > On Wed August 19 2009 11:06:11 am tpe wrote: >> It's even worse :). If t3 is of collection type, each element of that >> collection will become single element of the resulting >> List<JaxbElement<?>>. So, if for example t3 is a list with the size of 3, >> the final JaxbElement list will contain 5 elements. >> >> Lukasz Lichota wrote: >> > If I have complex type like this: >> > <xsd:sequence> >> > <xsd:element name="n1" type="t1" /> >> > <xsd:element name="n2" type="t2" /> >> > <xsd:choice> >> > <xsd:element name="n3" type="t3" /> >> > <xsd:element name="n4" type="t4" /> >> > </xsd:choice> >> > </xsd:sequence> >> > >> > then all this sequence is mapped to one field of type >> > List<JaxbElement<?>>, >> > why's that? can I force it to be mapped to two strongly typed fields >> plus >> > the choice mapped to JaxbElement<?> ? > > -- > Daniel Kulp > [email protected] > http://www.dankulp.com/blog > > -- View this message in context: http://www.nabble.com/xsd%3Achoice-in-xsd%3Asequence-tp25042291p25075932.html Sent from the cxf-user mailing list archive at Nabble.com.
