relax xs:all restriction of child elements having minOccurs 0 or 1 and maxOccurs 0 or 1

Please do not force child elements of xs:all to be restricted to having minOccurs or maxOccurs only be "0" or "1".  This restriction seems to currently be in force due to the definition of the "allModel" group.

Currently, its possible to allow a set of children to show up any number of times and in any order using a construct like:

<xs:choice minOccurs="0" maxOccurs="unbounded">
	<xs:element ref="e1" minOccurs="0" maxOccurs="unbounded"/>
	<xs:element ref="e2" minOccurs="0" maxOccurs="unbounded"/>
	<xs:element ref="e3" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>

and its possible to have the minOccurs and maxOccurs to something besides 1 if you don't mind keeping the order preserved:

<xs:sequence>
	<xs:element ref="e1" minOccurs="1" maxOccurs="2"/>
	<xs:element ref="e2" minOccurs="3" maxOccurs="4"/>
	<xs:element ref="e3" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>

What XML Schema needs is a straight forward way of saying "I don't care in what order the child elements show up, but these are the child elements that are legal". xs:all could be used to do that with something like:

<xs:all>
	<xs:element ref="e1" minOccurs="1" maxOccurs="2"/>
	<xs:element ref="e2" minOccurs="3" maxOccurs="4"/>
	<xs:element ref="e3" minOccurs="0" maxOccurs="unbounded"/>
</xs:all>

As it is in XML Schema 1.0, xs:all is not nearly as useful as it could be (http://www.w3.org/2001/XMLSchema.xsd doesn't even use it!!!!).

Please seriously consider this, or something like it for XML Schema 1.1.


Thanks!
-Daniel

Received on Friday, 5 April 2002 15:19:15 UTC