[Home] [By Thread] [By Date] [Recent Entries]

  • From: Ronald Bourret <rpbourret@r...>
  • To: xml-dev <xml-dev@l...>
  • Date: Sat, 13 Oct 2001 01:42:48 -0700

Eric van der Vlist wrote:
> Workarounds include:
> 
> - changing the design of your vocabulary to impose an order :(
> - choosing a more flexible and less intrusive schema language --RELAX
> NG, Schematron and even Examplotron allow unordered content models.
> - changing your schema to allow any sub-element at this location using
> the xs:any wildcard and eventually embedding a Schematron rule to
> perform the checks that will no longer be done by W3C XML Schema.

One other workaround is to use an optional wrapper element that contains
1 or more occurrences of the child. For example, instead of an all group
of:

   A, B*, C*, D

use an all group of:

   A, BWrapper?, CWrapper?, D

where BWrapper and CWrapper are:

   <!ELEMENT BWrapper (B+)>
   <!ELEMENT CWrapper (C+)>

Use of ? and + ensures that the wrapper element is non-empty.

-- Ron

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member