This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5161 - all model group min/maxoccurs confusing
Summary: all model group min/maxoccurs confusing
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC Windows XP
: P1 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: content models cluster
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2007-10-08 21:03 UTC by John Arwe
Modified: 2008-03-19 19:15 UTC (History)
0 users

See Also:


Attachments

Description John Arwe 2007-10-08 21:03:34 UTC
3.8.1 The Model Group Schema Component says "(all) contain all and only exactly zero or one of each element specified in {particles}. The elements can occur in any order. In this case, to reduce implementation complexity, {particles} is restricted to contain local and top-level element declarations only, with {min occurs}=0 or 1, {max occurs}=1."

this is then closely followed by 3.8.2 <all...> where it specifies minoccurs=(0|1):1 maxoccurs=1:1

In 3.8.1 the statement "{particles} is restricted to contain local and top-level..." gets confusing because it could be read to apply to <all> group as a whole, or to its individual particles.  

I think 3.8.1 intends to restrict the facet values on each particle, in which case the following formulation is clearer (to me)

o (all) contain all and only exactly zero or one of each element specified in {particles}. The elements can occur in any order. To reduce implementation complexity, each {particle} is restricted to a contain local or top-level element declaration only, with {min occurs}=0 or 1, and {max occurs}=1."
Comment 1 John Arwe 2007-10-26 15:22:30 UTC
This bug is from the SML workgroup as a whole, decided at 2007-10-25 telecon.
Comment 2 C. M. Sperberg-McQueen 2007-12-27 01:25:36 UTC
Thank you for calling our attention to the confusing statements about 
all-groups.  They are not only confusing in their own right, they are wrong.
That is to say, they are in conflict with changes the WG has agreed to make
in the rules governing all-groups (namely, that they are no longer restricted
to maxOccurs="1") which are reflected elsewhere (e.g. section 3.8.4.1.3).

This whole area needs to be revised and checked carefully.
Comment 3 Sandy Gao 2008-01-11 16:37:11 UTC
In schema 1.0, <element>s under <all> were not allowed to have maxOccurs value other than "1". In schema 1.1, this restriction has been removed.

Other parts of 3.8 have been updated to reflect this change. 3.8.1 didn't get updated, which was an oversight.

The same is true for the "{particles} is restricted to contain local and top-level..." comment. Schema 1.0 didn't allow <any> to appear under <all>, and schema 1.1 now allows it. 3.8.1 should have been updated to reflect this.

The WG examined sections 3.8.x at 2008-01-11 telecon and decided to update 3.8.1 to be in sync with the rest of the spec.
Comment 4 C. M. Sperberg-McQueen 2008-02-08 02:20:08 UTC
A wording proposal including changes for this issue went to the WG
on 7 February 2008:

  http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.consent.200801.html#composition

(member-only link).
Comment 5 C. M. Sperberg-McQueen 2008-02-08 19:56:02 UTC
The 'Structures Omnibus 1' proposal mentioned in an earlier comment
was adopted by the XML Schema Working Group today.

http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.consent.200801.html (member-only link)

The XML Schema WG believes that the changes adopted today resolve this
issue fully.  I'm changing its status accordingly.

The change in status should cause email to be sent to the originator of
this issue, to whom the following request is addressed.

Please review the changes adopted and let us know if you agree with this resolution of your issue, by adding a comment to the issue record and changing the Status of the issue to Closed. Or, if you do not agree with this resolution, please add a comment explaining why. If you wish to appeal the WG's decision to the Director, then also change the Status of the record to Reopened. If you wish to record your dissent, but do not wish to appeal the decision to the Director, then change the Status of the record to Closed. If we do not hear from you in the next two weeks, we will assume you agree with the WG decision.
Comment 6 John Arwe 2008-02-15 17:38:07 UTC
wrt the conflicting facet values (removed), ok
wrt the local/top-level (removed), ok

wrt the minoccurs/maxoccurs restrictions on all's {particles} members, I'm not sure if that is ok or not.  The restriction seems to have been removed.  While I vaguely remember doing so to be one of the schema 1.1 improvements, I simply want to confirm its removal was intentional since my bug did not assert that need.

I also note a typo in the schema components content for all in top of 3.8.2:
from: Content: (annotation?, ( | element | any)*)
to  : Content: (annotation?, (   element | any)*)
                             =====
  
Comment 7 C. M. Sperberg-McQueen 2008-03-05 02:18:12 UTC
This is to confirm that the removal of the text about min- and maxOccurs
was indeed intentional.  (Like the contradictory statements which 
originally drew the intention of the originator of the bug report, that
text should have been updated when we made the change to all-groups.)

The typo you noticed in the syntax diagram for the 'all' element was
the result of a common XSLT coding error and has been corrected. (For 
those who will not be able to rest until they know:  the | or other 
connector is to be inserted just when the element or group is not the 
first item in its containing group.  The stylesheet was testing on 
position() and was accordingly wrong-footed by the insertion of a comment 
in an inopportune location in the XML source.  The stylesheet has been 
corrected to use count(preceding-sibling::*) and tests show that the 
syntax of the 'all' element is no longer troubled by the ghost bar.)

John, I think the ball is back in your court.
Comment 8 John Arwe 2008-03-19 19:15:56 UTC
all good then