Hi Henry,
see inline...
> Henry Chin wrote:
>
> Hi,
> I have in my schema file the following complexType
>
> <xs:complexType name="ProgramType">
> <xs:choice maxOccurs="unbounded">
> <xs:element name="add" type="actionType"
> minOccurs="0"/>
> <xs:element name="delete" type="deleteType"
> minOccurs="0"/>
> <xs:element name="redeploy" type="actionType"
> minOccurs="0"/>
> <xs:element name="update" type="actionType"
> minOccurs="0"/>
> </xs:choice>
> <xs:attribute name="version" type="VersionType" use="required"/>
>
> </xs:complexType>
>
> When I marshal my object out to XML, the version attribute is not
> shown. I found out that the SourceGenerator creates two classes (and
> the associated descriptor classes) called ProgramType.java and
> ProgramTypeItem.java. My attribute "version" is located inside
> ProgramTypeItem.java. From a descriptor perspective
> ProgramTypeItem.java is considered to be a container (set to true).
> The marshaller does not output objects that are containers.
I haven't had a chance to verify your bug yet, but the version attribute
should definately appear in ProgramType and not ProgramTypeItem.
Which version are you using? If you are using the CVS version then it's
a definate bug which still needs to be fixed.
>
> Is there a way to get around this problem so that either:
> 1) SourceGenerator creates the "version" attribute inside
> ProgramType.java and not ProgramTypeItem.java. I would think this
> would be easier.
This is the correct approach.
>
> 2) To change the marshaller so that container objects are created.
> However, I think this would cause more problems.
This is not a good idea as it would lead to incorrect behavior.
Thanks,
--Keith
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev