[xsd-users] Sequence of choices in code generated by xsd

Boris Kolpackov boris at codesynthesis.com
Tue Mar 4 06:20:56 EST 2014


Hi Vladimir,

Vladimir Zykov <vladimir.zykov at doctormobile.us> writes:

> I encountered a problem with xsd when I have an unbounded sequence of
> choices. I use xsd built from latest sources in cxx-tree mode. It
> generates for each member of choice a sequence but I'd rather expect
> to have something like in code generated by xsde in cxx-hybrid mode.

Yes, C++/Tree and C++/Hybrid use different approaches to mapping
compositors to C++. C++/Tree flattens the structure which results
in simpler to use API but looses ordering information in some
cases. C++/Hybrid recreates the compositor structure precisely
which can lead to a fairly complex API for complex content models.
This earlier email has more information on this:

http://www.codesynthesis.com/pipermail/xsd-users/2010-March/002741.html

We are also thinking of adding some extra mechanism to C++/Tree to
allow preserving/specifying the element order for certain types.
Let me know if you are interested in hearing what we have so far
and maybe provide some feedback.

Boris



More information about the xsd-users mailing list