[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] unbounded element within an <all> tag
- From: Ronald Bourret <rpbourret@rpbourret.com>
- To: xml-dev <xml-dev@lists.xml.org>
- 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