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

Re: Several same elements

From: Eddie Robertsson <erobertsson@allette.com.au>
Date: Mon, 26 Aug 2002 17:41:11 +1000
Message-ID: <3D69DB97.4070301@allette.com.au>
To: Cyrill Zadra <czadra@geo.unizh.ch>
CC: xmlschema-dev@w3.org

>
>
>> However, if you do it this way you can't control the number of 
>> chapter elements that can appear on each level. If you need to do 
>> this you have to specify one complexType for each level. Also, note 
>> that you must have minOccurs="0" on the "inner" chapter element 
>> otherwise you'll get an infinite content model that parsers can't 
>> handle.
>
>
> With this solution I've got still the possiblity to have as much level 
> in the hierarchy I'd like to have, so it isn't bounded. Would there be 
> a way to handle this? 


Not unless you define a separate complexType for each level which means 
you can control the number of chapter elements each level can have. This 
will become hard though if you have many levels of chapters.
If you don't mind adding a few embedded Schematron rules you could 
probably check this constraint but this would add some more processing 
to your application. See [1] for more info on this.

Cheers,
/Eddie

[1] http://www.topologi.com/public/Schtrn_XSD/Paper.html
Received on Monday, 26 August 2002 03:41:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT