[xsd-users] [xsdtree] Inheritance elements order

Klaim - Joël Lamotte mjklaim at gmail.com
Tue Jun 19 09:29:52 EDT 2012


I see.

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 can't find a way to allow to write this:

<sprite>
     <graphics> ... </graphics>    <--- defined by sprite's type
     <sprite> ...</sprite>     <--- child
     <sprite> ... </sprite>     <----child
</sprite>

Instead i'm forced to use xs:sequence that forces me to have to write this:

<sprite>
     <sprite> ...</sprite>     <--- child
     <sprite> ... </sprite>     <----child
     <graphics> ... </graphics>    <--- defined by sprite's type

</sprite>

This is harder to read the longer you get hierarchy.

Fortunately, the format I'm writing is targeted at tools, not humans, but
it's still hard to read for people debugging those files, like me.

If you know a way to allow the first writing, I'm open to suggestions.

Joel Lamotte


More information about the xsd-users mailing list