Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Combining maxOccurs="unbounded" with all indicator

From: Jeni Tennison <jeni@------------.--->
To: Frans Englich <frans.englich@-----.--->
Date: 11/1/2004 1:27:00 PM
Hi Frans,

> 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.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


From k.buchcik@4... Mon Nov 01 14:29:50 2004
Received: from lisa.w3.org 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent