Hi Bruno,

The best is to send the code you use to instantiate your object to the
list.
According to your schema the <dd/> element is mandatory so I sum up your
problem:

- when creating the object by hand and try to marshal you have an
exception
- when castor is unmarshalling the object and then marshal it back, all
is fine

Am I correct?

Arnaud

> -----Original Message-----
> From: Bruno Cadonna [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 30, 2003 11:43 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] ValidationException: dd is a required 
> field.; doing marshaling
> 
> 
> hi,
> 
> i sent this email already last week to this mailing list and nobody 
> didn't answer me. maybe i explained my problem not clear 
> enough. anyway i try again!
> 
> i have following problem.
> 
> due to tests i made a xml-file directly with the generated classes of 
> castor 0.9.5. by creating the objects by myself (using castor's 
> generated classes, but without unmarshalling) and then i 
> marshaled them 
> in order to get the xml-file in xml format.
> this is my test xml-file:
> 
> <dl>
>    <dt>
>      <txt>test data</txt>
>    </dt>
>    <dd>
>      <txt>test definition</txt>
>    </dd>
>    <dt>
>      <txt>test data 2</txt>
>    </dt>
>    <dd>
>      <txt>test definition 2</txt>
>    </dd>
> </dl>
> 
> 
> the relevant part of my schema is:
> 
> <xs:element name="dl">
>    <xs:complexType>
>      <xs:sequence maxOccurs="unbounded">
>        <xs:element ref="dt"/>
>        <xs:element ref="dd"/>
>      </xs:sequence>
>      </xs:complexType>
> </xs:element>
> 
> <xs:element name="dd">
>    <xs:complexType>
>      <xs:choice minOccurs="0" maxOccurs="unbounded">
>        <xs:group ref="content-mix.group"/>
>      </xs:choice>
>    </xs:complexType>
> </xs:element>
> 
> <xs:element name="dt">
>    <xs:complexType>
>      <xs:choice minOccurs="0" maxOccurs="unbounded">
>        <xs:group ref="content-mix.group"/>
>      </xs:choice>
>    </xs:complexType>
> </xs:element>
> 
> when i marshal it i get the exception:
> ValidationException: dd is a required field.;
> 
> but when i change the sequence to a choice (with the same maxOccurs 
> attribute) all works fine.
> 
> i tried to unmarshal and then to marshal the xml-file leaving the 
> sequence in the complexType and it works as well.
> 
> shouldn't it work also when i create the object by myself?
> 
> maybe i forget to set anything, when i create the xml-file as 
> java object.
> 
> could somebody help me?
> 
> bye
> bruno
> 
> ----------------------------------------------------------- 
> 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