users@jaxb.java.net

Re: Re: Issue with types that refer to themselves, and arrays

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 17 Sep 2008 08:21:57 +0200

On Tue, Sep 16, 2008 at 9:56 PM, Reif, Benjamin <benjamin.reif_at_cgi.com>wrote:

>
> I think you get more re-use because I can reference use type="tns:GroupArray"
> in other elements. Otherwise it comes out looking something like:
>
>
>
> <xs:element form="qualified" minOccurs="0" name="groups"
> nillable="true">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element form="qualified"
> maxOccurs="unbounded" minOccurs="0" name="Group" nillable="true"
> type="ns0:Group"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
>
I wouldn't like this either. - I have annotated the xxxGroups properties the
way you
wrote except for the type=Group[].class, and I get
   <xs:complexType name="Group">
     <xs:sequence>
        <xs:element name="groupGroups" type="tns:Group" ... minOccurs="0"
maxOccurs="unbounded"/>
    </..>
  </...>
Since this is the way I use to write the XML schemas, I'm perfectly happy
with that.
Is this also something your "other tools" don't like?


> Unfortunately we also have to use JDK 1.5, so using 1.6 isn't an option.
>
> You'd only need the schemagen from 1.6 - that shouldn't be a problem.

Cheers
Wolfgang


>
>
>