[EMAIL PROTECTED] wrote:
>
> >>>>> "Keith" == Keith Visco <[EMAIL PROTECTED]> writes:
>
> > Date: Thu, 31 Oct 2002 13:56:54 -0600
> > From: Keith Visco <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Re: [castor-dev] [Source Generator] lists and names
>
> > Steffen Fiedler wrote:
> >>
> >> Hi,
> >>
> >> I create a class that comtains a list of objects from my own Classes:
> >>
> >> <!--======================Group===================-->
> >>
> >> <xsd:element name="Group">
> >> <xsd:complexType>
> >> <xsd:sequence>
> >> <xsd:element name="id" type="xsd:integer"
> >> minOccurs="1" maxOccurs="1"/>
> >> <xsd:element name="name" type="xsd:string"
> >> minOccurs="1" maxOccurs="1"/>
> >> <xsd:element name="users" ref="User"
> >> maxOccurs="unbounded"/>
> >> </xsd:sequence>
> >> </xsd:complexType>
> >> </xsd:element>
> >> <!--======================User=======================-->
> >> <xsd:element name="User">
> >> <xsd:complexType>
> >> <xsd:sequence>
> >> <xsd:element name="id" type="xsd:integer"
> >> minOccurs="1" maxOccurs="1"/>
> >> <xsd:element name="name" type="xsd:string"
> >> minOccurs="1" maxOccurs="1"/>
> >> </xsd:sequence>
> >> </xsd:complexType>
> >> </xsd:element>
> >>
> >> That works, but i have two questions:
> >> -Why is the name-attribute of the list-element ignored? How can i generate
> >> methods get/setUsers() instead of get/setUser() ?
>
> I get a get/setName set in the list-element.
Castor is generating the correct method name...
>
> > Sounds like a bug.
>
> Is it specified that getUsers should be generated? the element is
> called "users", while the reference is to "user". I think the name
> attribute is ignored, if ref is present.
>
Actually, an error should be reported that both ref and name are not
allowed to appear together. But your right, the name attribute will be
ignored, since the ref attribute is present. Castor is generating the
correct code, but an error should really be thrown to tell the user that
the Schema is actually invalid.
--Keith
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev