Hi guys,

I'm starting out with xstream, trying to parse XML data based on a XSD
into objects. This works well except for nested lists of choice
elements. For example this XSD definition:

    <xs:sequence>
      <xs:choice>
        <xs:element ref="volvo"/>
        <xs:element ref="chevy"/>
        <xs:sequence>
          <xs:element ref="policeCar"/>
          <xs:element ref="officerName" minOccurs="0" maxOccurs="2"/>
        </xs:sequence>
      </xs:choice>
    </xs:sequence>

In other words, this would be valid data:

<volvo color="red" />
<chevy color="blue" />
<policeCar />
<officerName>Smith</officerName>
<officerName>Jones</officerName>
<volvo color="green" />

I was thinking to make a generic wrapper that contains volvo, chevy
and policeCar...when added to a list with the @XStreamImplicit
annotation I suspect this to work. However for each policeCar there
might be officers. The only way i'd see this work is using a wrapper
around the policeCar and list of Officers...but that would break the
XSD since the wrapper name would be included in the XML. Or would
there be a way to 'hide' the wrapper object?

Is there any way to properly map this XSD to objects? Any tips or
suggestions would be very welcome!

Thanks!
Xandrios

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to