Is there any reason why <xs:group>
cannot appear inside <xs:all>
, but only inside <xs:sequence>
?
Let's see an example. Say, there is a list of tags (<a>
to <d>
and <e>
to <f>
- see example below) which do not appear in any particular order, but always wrapped into another object (either <foo>
or <bar>
); <foo>
={<a>
, <b>
, <c>
, <d>
}; <bar>
={<e>
, <b>
, <c>
, <f>
}:
<foo>
<a>a1</a>
<b>b1</b>
<c>c1</c>
<d>d1</d>
</foo>
<foo>
<d>d2</d>
<b>b2</b>
<c>c2</c>
<a>a2</a>
</foo>
<bar>
<e>e3</e>
<b>b3</b>
<c>c3</c>
<f>f3</f>
</bar>
I want to extract tags <b>
and <c>
into xs:group
and use <xs:group ref="...">
when defining complexType of <foo>
and <bar>
in the XSD. However, due to the restriction mentioned above, this is not possible.
What would you suggest as a workaround for the given problem? Chances are, I am doing something stupid, but again why is this incorrect?