Hi,

when I Marshal a Object which was generated with Castor and then try to 
Unmarshal the Document
I get the Message "-error-if-this-is-used- is a required field."

The problem is this xsd Fragment:

    <xsd:complexType name = "Family">
        <xsd:sequence>
            <xsd:element name = "Version" type = "xsd:integer"/>
            <xsd:choice>
                <xsd:element name = "PropertyScope" type = "tdx:Code" 
minOccurs = "0" maxOccurs = "unbounded">
                    <xsd:annotation>
                        <xsd:documentation>
                            Code des Herstellers oder Suppliers als 
Verweis auf alle der Familie zugeordneten Properties
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
                <xsd:element name = "PropertyUsage" minOccurs = "0" 
maxOccurs = "unbounded">
                    <xsd:annotation>
                        <xsd:documentation>
                            Code des Herstellers oder Suppliers als 
Verweis auf alle der Familie zugeordneten Properties
                        </xsd:documentation>
                    </xsd:annotation>
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base = "tdx:Code">
                                <xsd:attribute name = "isOptional" 
default = "true" type = "xsd:boolean"/>
                            </xsd:extension>
                        </xsd:simpleContent>
                    </xsd:complexType>
                </xsd:element>
            </xsd:choice>
        </xsd:sequence>
    </xsd:complexType>

   
When I Marshall the Object it works fine. In the generated result-File 
there is one "Family" which has
no "PropertyScope" and no "PropertyUsage". Which seem to be OK.
But when I Unmarshal the File it says to me "-error-if-this-is-used- is 
a required field.". Which means
that he is waiting for a "PropertyScope" or a "PropertyUsage" Element.

Is there something wrong with the schema? Choice means that there have 
to be one element.  - "PropertyScope"
or "PropertyUsage". But their minOccur could be "0".

regards,
Stefan

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

Reply via email to