[xsd-users] [xsdtree] Inheritance elements order

Boris Kolpackov boris at codesynthesis.com
Tue Jun 19 10:26:35 EDT 2012


Hi Joël,

Klaim - Joël Lamotte <mjklaim at gmail.com> writes:

> Do you have any suggestion to solve the problem of element orders?
> It is a great pain: my base type is called "object" and is abstract. It
> define that there can be a sequence of object inside the element.
> Now, my child types, like sprite, also define some additional elements,
> like the graphic properties, named "graphics".

I don't think you can do anything about this in your current setup.
You could get rid of the base and use element groups instead. Not very
OO but will work. Another alternative would be to use substitution
groups (i.e., in the base have a single abstract element which is
extended as sprite, graphics, etc). One advantage of this approach
is that you will be able to determine order of elements in C++/Tree.
The disadvantage is that it will result in a schema that is a bit
looser than what you want.

Boris



More information about the xsd-users mailing list