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 2196 - R-204: ComplexType mapping rule issue: min=max=0
Summary: R-204: ComplexType mapping rule issue: min=max=0
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: unspecified
Hardware: All All
: P4 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: thimble, easy
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2005-09-14 19:03 UTC by Sandy Gao
Modified: 2009-04-21 19:21 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2005-09-14 19:03:11 UTC
What is the content type of the following? 

<complexType>
  <sequence min=max=0>
    <element .../>

According to the complexType complexContent mapping rules, because there IS a 
sequence with an element child, the effective content is not empty, but is the 
particle corresponding to the sequence. But according to section 3.8.2, 
min=max=0 corresponds to no component at all. 

Shouldn't 2.1.1 of the definition of effective content in the mapping rules (of 
2nd edition) be changed to:

2.1.1 There is no <group> <all> <choice> or <sequence> among the [children], 
which either doesn't have a maxOccur attribute, or the actual value of such 
attribute is not 0. 

See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2003JanMar/0038.html
Comment 1 C. M. Sperberg-McQueen 2006-09-19 19:58:29 UTC
There does seem to be a discrepancy between the two locations.

But instead of making 2.1.1 more complicated, I think it would
be simpler to address the case where the outermost group
has min=max=0 with a separate clause (a new 2.1.4, that is), 
so that the beginning of 2.1 reads:

  2.1 If  one of the following is true

    2.1.1 There is no <group>, <all>, <choice> or <sequence> among the
          [children];

    2.1.2 There is an <all> or <sequence> among the [children] with no
          [children] of its own excluding <annotation>;

    2.1.3 There is a <choice> among the [children] with no [children]
          of its own excluding <annotation> whose minOccurs
          [attribute] has the ·actual value· 0;

    2.1.4 The only <group>, <all>, <choice> or <sequence> among the
          [children] has a maxOccurs [attribute] with an actual value
          of 0;

  , then the appropriate case among the following:  ...

(I entertained an alternative analysis, that this case was 
correctly excluded, so as to create an unsatisfiable particle,
but min=0 is never unsatisfiable, and min=max=0 is 
satisfied by the empty sequence, no matter what the min and
max are on.  So the particle created in the status quo accepts
the empty sequence, and only the empty sequence.  We might
as well make it use the keyword.)
Comment 2 C. M. Sperberg-McQueen 2006-10-27 21:08:31 UTC
At its telcon of today, the WG accepted the analysis and wording proposal
in comment #1.  The change will appear in the next version of the
status quo document.