W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Re: Cannot do any order and control the maxOccurs.

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 27 Feb 2002 09:32:51 +0000
Message-ID: <951719372.20020227093251@jenitennison.com>
To: Christopher Birkett <christopherbirkett@yahoo.com>
CC: xmlschema-dev@w3.org
Hi Chris,

> XML Schema Limitation:
> 1.  You cannot specify any order and have some, but
> not all, of the elements' frequency greater than one.
>          To almost get around this limitation (if we
> want any order and control the frequency) we have 2
> options:
>          1)  We would have to declare <Extension> as
> an XML Schema list type.
>          2)  We could specify any order and any
> frequency for all items (choice maxOccurs="unbounded")

A third option would be to define wrapper elements for the elements
that can repeat:


This would allow you to use xs:all to indicate that the elements
within App can go in any order:

    <xs:element ref="cn" />
    <xs:element ref="Extensions" />

Which would mean that the following is also legal:


The other options, as mentioned on this list recently, are:

 - to list all the possible combinations of orders; this gets unwieldy
   if you have lots of elements that are intermingled.

 - create a canonical schema in which the order is fixed; if
   necessary, you can write a simple script or stylesheet to transform
   instances into documents with this ordering

Out of interest, why is it important to you to allow elements to be in
any order?



Jeni Tennison
Received on Wednesday, 27 February 2002 04:32:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC