Apologies if this question is too easy or if I have not read the schema documentation enough.
My schema is like this: There will be a choice between one of the two groups a and b.
...
<xs:choice>
<xs:group ref="a"/>
<xs:group ref="b"/>
</xs:choice>
...
however if I have the following group declaration it will not pass. The error message will say that "X" cannot appear in both groups.
...
<xs:group name="a">
<xs:sequence>
<xs:element ref="X"/>
<xs:element ref="Y"/>
</xs:sequence>
</xs:group>
<xs:group name="b">
<xs:sequence>
<xs:element ref="X"/>
<xs:element ref="Z"/>
</xs:sequence>
</xs:group>
...
...
The strange thing is that if I have the following combination it will
not work:
XY XY
XY XX
However the following will work:
XY YX
XX YX
XY YY
This means that it will only fail if the first element of both group
is the same. Anything else will pass. This seemed really strange
to a newbie like me. Is there anyway around it? By the way I am using the validator from here:
http://tools.decisionsoft.com/schemaValidate.html