W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2003

allow unordered sequence

From: David Wright <dawright@microsoft.com>
Date: Thu, 06 Mar 2003 11:33:25 -0700
Message-Id: <5.1.0.14.1.20030306113320.0243b930@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT