Hi Diez,

Castor can handle that if you use an XML Schema and generate sources
from this schema:

<element name='parent'>
    <complexType>
       <choice maxOccurs="unbounded">
            <element name="child_a" type=..../>
            <element name="child_b" type=..../>
       </choice>
    </complexType>
</element>


Hope that helps,

Arnaud

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 19, 2002 7:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Splitting the XML up in multiple Ojects
> 
> Hi,
> 
> I'm new to CASTOR XML, but from what I know thats possible. What I
don't
> know
> (but would like to..) is how castor delas with things like this:
> 
> <parent>
>       <child_a/>
>       <child_b/>
>       <child_a/>
>       <child_a/>
>       <child_b/>
> </parent>
> 
> The element decl for parent could look like this:
> 
> <!ELEMENT parent (child_a|child_b)*>
> 
> How's that handled? Using the "matches" regexp?
> 
> Regards,
> 
> Diez
> 
> Am Dienstag, 19. M�rz 2002 09:28 schrieb Bram Huenaerts:
> > Is it possible to unmarshal the following XML file to book and other
> > Objects?
> >
> > <item>
> >  <book>
> >   <title>test</title>
> >  <book>
> >  <book>
> >   <title>another title</title>
> >  </book>
> >  <serial>
> >   <title>serial title</title>
> >  </serial>
> > </item>
> >
> > With this example I would like to have 2 Book objects and 1 Serial
> Object
> > after unmarshalling.
> > Is this possible?
> 
> -----------------------------------------------------------
> 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

Reply via email to