What I'm trying to achieve is allow within one element either one set of elements or another. I thought I achieved this creating a choice element of either an element or a group and it parsef fine with my old version 4 of xml spy, but it turns out it is incorrect due to 'the group ref to "all" is not the root particle'
As an example, for the element 'data' I want to allow either one set of fields or another, as in:
Expand|Select|Wrap|Line Numbers
- <data>
- <none />
- </data>
Expand|Select|Wrap|Line Numbers
- <data>
- <field1 />
- <field2 />
- </data>
Expand|Select|Wrap|Line Numbers
- <xs:element name="data" type="formtype" />
- <xs:group name="form">
- <xs:all>
- <xs:element name="field1" />
- <xs:element name="field2" />
- </xs:all>
- </xs:group>
- <xs:complexType name="formtype">
- <xs:choice>
- <xs:element name="none" />
- <xs:group ref="form"/>
- </xs:choice>
- </xs:complexType>
The thing I really don't understand is if I change xs:all to xs:sequence then it is valid, yet the difference between the two that I know is simply sequence must all be there and in the right order, and all must all be there but in any order, and I need the elements to be any order.
Any help in fixing this would be appreciated :)
Neil.