[xsd-users] <choice> abuse

Boris Kolpackov boris at codesynthesis.com
Tue Mar 13 16:51:56 EDT 2007


Hi Ray,

I've CC'ed xsd-users back in so that this will get archived and
available to others.


Ray Lischner <rlischner at proteus-technologies.com> writes:

> You present a convincing argument for the flat choice. Perhaps
> one solution is for the generated code to automatically call
> reset() for the other choices, e.g.,
>
> void email::to(const to::type& to)
> {
>   this->_xsd_to_.set(to);
>   this->_xsd_cc_.reset();
>   this->_xsd_bcc_.reset();
> }

This can certainly be done. Though it will only work for <choice>
that has maxOccurs == "1" and is not nested in another compositor
with  maxOccurs > "1". Otherwise the choice members are mapped
to sequences and the fix does not apply anymore. But I guess
this is better than nothing. I've added it to my TODO list.

Thanks for the suggestion!

-boris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070313/67f7477a/attachment.pgp


More information about the xsd-users mailing list