Your schema seems wrong. "use=optional" should be used with xs:attribute
rather than xs:element. To specify xs:element optional, use minOccurs="0"
[EMAIL PROTECTED] wrote:
The Castor code generator is marking all elements in my schema as required
(in the Descriptor class) even when the schema defaults or is explicitly
set to optional. This results in errors when trying to marshall an object
that has left optional fields empty.
Schema:
<xs:element name="Amount" type="xs:decimal" use="optional"/>
Generated descriptor class:
desc.setRequired(true);
Davinder Kohli, you reported a problem a few days ago that may be the same
root problem, you are getting an exception when trying to marshall an
optional element. You can look in the generated Descriptor class for the
element and see if the generator set the field as required even tho your
schema doesn't indicate that it is required.
This is version 9.6 of Castor.
----------------------------------------------------------------
Alice Sufka
Office: 503-401-5262
----------------------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------