allow unordered sequence

This is a request for the next version of XML-Schema. Please allow a way to 
specify that an element may have various numbers of child elements in any 
order. For example:

<A> must contain&

0 or 1 <a/> s

exactly 1 <b/>

any number of <c/> s

             &in any order

(I have learned that it is actually possible to do this by implementing a 
decision tree using <xsd:choice> and <xsd:sequence>, and for this toy 
problem that isn t too bad. In my real-world scenario, though, I have 11 
child elements.)



I realize that, if one changes the schema so that <c/> s are contained 
within a <C> element and makes the <C> element a child of <A>, one can do 
this using <xsd:all>. Not all of us attempting to validate documents using 
XML-Schema, though, have the possibility of changing to schema used. We 
need to be able to express a rule that existed in someone s else s head, to 
whom it never occurred that the rule might some day need to be expressed in 
XML-Schema.



It may make implementations easier to require that like child elements 
occur together, e.g. that

             <A><b/><c/><c/></A>

is allowed, but

<A><c/><b/><c/></A>

isn t. This would still be a great improvement.



A simple way to do this simple, at least, at the spec level -- is to relax 
the condition that, for child elements of <xsd:all>, minOccurs and 
maxOccurs can only be 0 or 1.

Received on Thursday, 6 March 2003 13:34:56 UTC