You misunderstood how xs:all can be used in a Schema.
See
http://www.w3.org/TR/xmlschema-0/#groups
for more details.
I agree that the error message needs to be deciphered by ordinary
practitioners of XML ;-)
On Wednesday, March 19, 2003, at 10:19 AM, Mark Shelton wrote:
> What is wrong with this schema? Using xjc.bat, I get the following
> error message? When I comment out the "<xs:group ref="group"/>" line,
> xjc.bat works.
>
> [ERROR] cos-all-limited.1.2: An ''all'' model group must appear in a
> particle with '{'min occurs'}'='{'max occurs'}'=1, and that particle
> must be part of a pair which constitutes the '{'content type'}' of a
> complex type definition.
> line 7 of sample.xsd
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="namespace" xmlns="namespace"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="complex">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="x" type="xs:string"/>
> <xs:group ref="group"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:group name="group">
> <xs:all>
> <xs:element ref="a"/>
> <xs:element ref="b"/>
> <xs:element ref="c"/>
> </xs:all>
> </xs:group>
> <xs:element name="a" type="xs:string"/>
> <xs:element name="b" type="xs:string"/>
> <xs:element name="c" type="xs:string"/>
> </xs:schema>