I too have unmarshal problem with choice.

My schema is like this:

        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
        <xs:element name="setup" type="setupType"/>
        <xs:complexType name="setupType">
                <xs:choice>
                        <xs:group ref="aSetupType"/>
                        <xs:group ref="bSetupType"/>    
                </xs:choice>
                <xs:attribute name="setup_name" type="xs:string"/>
        </xs:complexType>

        <xs:group name="aSetupType">
                <xs:sequence>
                        <xs:element name="t" type="a_tType"/>
                        <xs:element name="a_child" type="aChildType"/>                
                </xs:sequence>
        </xs:group>

        <xs:group name="bSetupType">
                <xs:sequence>
                        <xs:element name="t" type="b_tType"/>
                        <xs:element name="b_child" type="bChildType"/>                
                </xs:sequence>
        </xs:group>


castor could not unmarshal the following, which was generated by its own marshal framework: <setup setup_name="B"> <t>b_tType content</t> <b_child>bChildType content</b_child> </setup>

change the order of aSetupType and bSetupType in the choice block, it can unmarshal 
the above,
but it could not marshal

    <setup setup_name="A">
       <t>a_tType content</t>
       <a_child>aChildType content</a_child>
     </setup>

Can anyone tell me how to get arround of this?

Thanks

Honglin



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

Reply via email to