Steffen,
The 'type' attribute is for XML Schema types, not java types.
What is the data type of roles? If it is string,
you could use this:
<xsd:element name="roles" type="xsd:string"
minOccurs="1" maxOccurs="unbounded"/>
I changed 'xsd:roles' to 'xsd:string' and the maxOccurs from "1" to
"unbounded".
This will generate a vector (not arraylist) that handles strings.
If a role is something other than a string, use type="role" (instead of
type="arrayList")
The define a 'role' structure like this:
<complexType name="role">
<sequence>
<element name="foo" type="xsd:string"/>
<element name="bar" type="xsd:string"/>
</sequence>
</complexType>
If your determined to get an arraylist instead of a vector,
there will be more work to do.
Hope that helps,
--Erik
> -----Original Message-----
> From: Steffen Fiedler [mailto:steffen.fiedler@;sourcepark.de]
> Sent: Monday, October 28, 2002 7:49 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] SourceGenerator and ArrayList
>
>
> Hi,
>
> I try to generate the Code for a Class containing an Arraylist.
> Wich type i have to use in the xsd-file?
>
> In the documentation, i only found the information, that it
> is possible.
>
> I tried:
>
> <xsd:element name="User">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="id"
> type="xsd:integer" minOccurs="1" maxOccurs="1"/>
> <xsd:element name="personId"
> type="xsd:integer" minOccurs="1" maxOccurs="1"/>
> <xsd:element name="name"
> type="xsd:string" minOccurs="1" maxOccurs="1"/>
> <xsd:element name="password"
> type="xsd:string" minOccurs="1" maxOccurs="1"/>
> <xsd:element name="roles"
> type="xsd:arraylist" minOccurs="1" maxOccurs="1"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> But i get the errormessage:
> type not found for element: roles
>
> Can anyone give me an example or link, how to do it correctly?
>
> Thanks,
> Steffen
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev