[xsd-users] Sequence + Choice (or Alternative)

Marvin M. xsd-users at groenndemon.de
Thu Apr 15 09:22:54 EDT 2010


Hi Boris,

Boris Kolpackov schrieb:
> The following post explores this issue as well as the various solutions 
> in great detail:
> 
> http://www.codesynthesis.com/pipermail/xsd-users/2010-March/002741.html

I found that post through Google today.

> If you want to use the substitutions group approach, then you will need
> to create an abstract <rule-term> element and derive <non-terminal>, 
> <terminal>, and <string> from it. Then, instead of using a sequence of 
> choices, you will simply use the sequence of <rule-term> elements (which, 
> in the actual XML document will be substituted with one of the concrete 
> elements). The post mentioned above has an example schema fragment that 
> shows how to do this.

I tried that, but then I had several global elements (the abstract
element and its substitution derivations) which were all legal to use as
the document root (xsd.exe complained that it didn't know which one was
the root).
Also, the schema was much more complex, larger in size and harder to read.

Unless you have a solution for those problems, I think I'll stick with
the old choice and use the XSD/e approach instead, even though the
syntax is less neat.

Thanks,
Marvin



More information about the xsd-users mailing list