W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2004

Re: Combining maxOccurs="unbounded" with all indicator

From: Frans Englich <frans.englich@telia.com>
Date: Mon, 1 Nov 2004 17:55:13 +0000
To: Jeni Tennison <jeni@jenitennison.com>
Cc: "Xmlschema-dev" <xmlschema-dev@w3.org>
Message-Id: <200411011755.13652.frans.englich@telia.com>

On Monday 01 November 2004 13:26, Jeni Tennison wrote:
> Hi Frans,

Hello Jeni,

Thanks for your extensive reply.

> > How do I achieve this -- allow multiple unbounded elements to be
> > freely mixed with each others and simple elements?
> This is probably the most frequent of FAQs.
> DTDs have a similar restriction, and the traditional approach is to
> define the model using something like:
>   ((include | group)*, kcfgfile, (include | group)*)
> However, this allows zero <include> or <group> elements. To get the
> minimum of one for both of these elements requires a content model
> that's really quite complex, although if you use groups that will make
> it easier to specify.
> Another approach is to accept that you can't express this constraint
> using XML Schema and instead use a more forgiving content model, such
> as:
>   (include | kcfgfile | group)*
> and express the extra constraints about the number of times each of
> these elements can appear in a separate schema language, such as
> Schematron.
> Or you can define the content model with order constrained, as in:
>   (include+, kcfgfile, group+)
> and use a (XSLT) transformation to get from your unordered XML to an
> ordered XML which you then validate against the schema.
> Or you can change your markup language so that you only accept the
> elements in a constrained order.
> Or you can change your schema language to RELAX NG, which supports
> this kind of constraint very easily.

In other words, one _have_ to use other technologies in order to solve my 
case. And I who switched from DTD to XML Schema in order to get rid of 
exactly this problem.

Why does this limitation exist in the XML Schema? Wasn't it a known limitation 
in the DTD language..? Will this be fixed in future versions? (perhaps this 
is documented somewhere)


Received on Monday, 1 November 2004 17:48:32 UTC

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