<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6202</bug_id>
          
          <creation_ts>2008-11-02 20:03:44 +0000</creation_ts>
          <short_desc>All group extending &quot;empty mixed&quot; content</short_desc>
          <delta_ts>2008-11-24 15:18:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.1 only</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          <cc>David_E3</cc>
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22330</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-11-02 20:03:44 +0000</bug_when>
    <thetext>As far as I can see, it is valid to do this:

&lt;xs:complexType name=&quot;B&quot; mixed=&quot;false&quot;&gt;
 &lt;xs:all/&gt; &lt;!-- or equivalently &lt;xs:sequence/&gt; --&gt;
&lt;/xs:complexType&gt;

&lt;xs:complexType name=&quot;E&quot; mixed=&quot;false&quot;&gt;
 &lt;xs:complexContent&gt;
  &lt;xs:extension base=&quot;B&quot;&gt;
   &lt;xs:all&gt;
    &lt;xs:element name=&quot;P&quot;/&gt;
    &lt;xs:element name=&quot;Q&quot;/&gt;
   &lt;/xs:all&gt;
  &lt;/xs:extension&gt;
 &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

But it becomes invalid if both the mixed attributes are changed to mixed=&quot;true&quot;. In the former case, xs:all extending empty is allowed. But in the latter case, the variety of B is mixed, with content type being an empty group with compositor = sequence. The extension will then be constructed with a content model of

&lt;sequence&gt;
  &lt;sequence/&gt;
  &lt;all&gt;
    &lt;xs:element name=&quot;P&quot;/&gt;
    &lt;xs:element name=&quot;Q&quot;/&gt;
  &lt;/all&gt;
&lt;/sequence&gt;

which is not valid under 3.8.6.2 All Group Limited.

The underlying problem here is that the varieties (empty, mixed, element-only, simple) are not fully orthogonal. Really there should be two orthogonal boolean properties: can-contain-elements and can-contain-text. But short of a radical remodelling, I think it can be fixed by changing 3.4.2.3.3 clause 4.2.3.2 from 

&quot;4.2.3.2 If the {term} of the ·base particle· has {compositor}  all and the {term} of the ·effective content· also has {compositor}  all, ...&quot;

 to 

&quot;4.2.3.2 If the {term} of the ·effective content· has {compositor}  all and one of the following conditions is true: 

4.3.2.3.1 the {term} of the ·base particle· also has {compositor}  all,

4.3.2.3.2 the {term} of the ·base particle· is a model group whose {compositor} is sequence and whose {particles} is empty, ....

(alternatively, introduce a new case into the 4.3.2.x list)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22355</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-11-05 11:58:21 +0000</bug_when>
    <thetext>It might also be worth observing that although the XML mapping rules never generate a model group whose {compositor} is *all* and whose {particles} is empty, the schema component model allows such a model group to exist. It generally seems a bad idea to allow components to exist for which there is no XML representation.

(HT has pointed out another case, the component model does not prevent an *all* group containing particles other than element particles and wildcard particles.)

On a related point, a singleton *sequence* and a singleton *all* model group are equivalent from the point of view of validation, and from the point of view of the rules on valid restriction; but they are not equivalent when it comes to derivation by extension. (If operator syntax is used, as in (A,B) for sequence or (A&amp;B) for interleave, it becomes clear that for singleton groups there should be no distinction.) Should we make them equivalent in the component model, or at least allow both to be extended in the same ways?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22514</commentid>
    <comment_count>2</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2008-11-24 15:18:57 +0000</bug_when>
    <thetext>Telcon 2008-11-21
Status quo:
If you have something truly empty, you can go to anything; mixed or not.
If you have something which is mixed but allows no element children, you
can go to sequence and mixed, and choice and mixed, but not to all and
mixed.

MSM&apos;s instinct is to fix non-orthogonality by removing the special-case
for all, which is probably too much trouble right now. Don&apos;t like
repairing non-orthogonality by adding more special rules.

MK: One thing we could do is remove special case for empty all, which
removes that point of non-orthogonality.
MSM: Could then just replace rules that appeal to empty sequence to
apply to empty all as well.
MK: But variety empty=empty sequence.

SG: Think there is no real problem here. Think any change is risky.

Agreement, or acceptance of this view.

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>