When I do a simple 'choice' in XML Schema, the
generated Castor classes require all of the
sub-elements to be present, instead of requiring
exactly 1. Is this a known bug? Or am I doing
something wrong?

The XSD looks like this:

<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema 
     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
     elementFormDefault = "qualified">
  <xsd:element name = "a">
    <xsd:complexType>
       <xsd:choice>
         <xsd:element ref = "b"/>
         <xsd:element ref = "c"/>
       </xsd:choice>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name = "b" type = "xsd:string"/>
  <xsd:element name = "c" type = "xsd:string"/>
</xsd:schema>

The following should be valid XML for this schema, but
when I unmarshal with validation on, it fails.

<a>
  <b>xxx</b>
</a>

Error:
ValidationException: c is a required field.;


Thanks,
Mark

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to