- From: Morris Matsa <mmatsa@us.ibm.com>
- Date: Thu, 4 Oct 2001 09:57:22 -0400
- To: "Bruno Chatel" <bcha@chadocs.com>
- Cc: <xmlschema-dev@w3.org>, <bcha@chadocs.com>
That behavior seems correct. I believe that it was thought that possible
occurance constraints on the top level of a group would be more appropriate
on the use of the group (not the definition of the group). Furthermore,
people disagreed about how to apply two sets of occurance constraints ---
one on the use and the other on the top level collection. Thus, the spec
forbids one of them.
Your workaround should be just fine. Personally, I'd rather use a sequence
than a choice, because a one-element sequence seems more natural and clear
to me than a one-element choice, but either should work.
Morris
"Bruno Chatel" <bcha@chadocs.com>@w3.org on 10/04/2001 09:26:25 AM
Sent by: xmlschema-dev-request@w3.org
To: <xmlschema-dev@w3.org>
cc: <bcha@chadocs.com>
Subject: Group : Model content and occurence specifications
Hi,
I have a validation problem on my schema : maxOccurs attribute
is not allowed on this choice element :
<xs:group name="blocs.mix">
<xs:annotation>
<xs:documentation>...</xs:documentation>
</xs:annotation>
<xs:choice maxOccurs="unbounded">
<xs:group ref="index.class"/>
<xs:group ref="encadrés.class"/>
<xs:group ref="inters.class"/>
<xs:group ref="blocs.class"/>
</xs:choice>
</xs:group>
It seems that the error is relative to the explanation
provided in the specification Part 1, end of 3.7.2
http://www.w3.org/TR/xmlschema-1/#declare-namedModelGroup
Is it true ?
I do not understand the reason why there is this limitation.
In order to modelize this, is it acceptable to write a un-useful
parent for choice element ?
Something like :
<xs:group name="blocs.mix">
<xs:annotation>
<xs:documentation>...</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:choice maxOccurs="unbounded">
<xs:group ref="index.class"/>
<xs:group ref="encadrés.class"/>
<xs:group ref="inters.class"/>
<xs:group ref="blocs.class"/>
</xs:choice>
</xs:choice>
</xs:group>
Thanks in advance.
Regards,
-- bruno --
----------------------------------------
Bruno Chatel
Tel : (+33)[0] 4 96 11 14 57
Email : bcha@chadocs.com
----------------------------------------
Received on Thursday, 4 October 2001 10:01:59 UTC