<?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>5943</bug_id>
          
          <creation_ts>2008-08-07 21:52:13 +0000</creation_ts>
          <short_desc>ComplexContent extending SimpleContent</short_desc>
          <delta_ts>2009-02-19 18:20:11 +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>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>needsAgreement</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>tobias.koenig</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>21477</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-08-07 21:52:13 +0000</bug_when>
    <thetext>Consider the pathological test case particlesZ031 in the Microsoft part of the test suite

  &lt;xs:complexType name=&quot;Type1&quot;&gt;
    &lt;xs:simpleContent&gt;
      &lt;xs:extension base=&quot;xs:string&quot;&gt;
        &lt;xs:attribute name=&quot;Field1&quot; type=&quot;xs:string&quot; /&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:simpleContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name=&quot;Type2&quot;&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base=&quot;Type1&quot;&gt;
        &lt;xs:attribute name=&quot;Field2&quot; type=&quot;xs:string&quot; /&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;

In Schema 1.0 the {content type} of Type2 is computed as follows:

1. The effective mixed is false

2. The effective content is empty

3.2.1 Therefore the {content type} is the {content type} of the base type definition, namely SIMPLE.

Clearly this is perverse since the type specifies complexContent, but that&apos;s what the rules say.

In 1.1 the effect is different (section 3.4.2.3.3).

1. The effective mixed is false

2. The effective content is empty

3. The explicit content is empty

4.2.1 applies, and takes us to 4.1.1, giving an explicit content type of (empty, absent, absent, absent)

5. The wildcard element is absent

6. The {content type} is the explicit content type, namely (empty, absent, absent, absent)

So this time we have complex (empty) content, which means that by extending a type that allows string content we have created a type that allows no content at all.

I think this case should simply be banned: a type with &lt;complexContent&gt; should not be allowed to extend a base type with variety=simple.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22282</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2008-10-29 21:08:48 +0000</bug_when>
    <thetext>The WG discussed this issue during the ftf today.

The status quo does in fact generate a result pretty much as described
in the bug description, but the status quo also satisfies the demand that
the example not be legal:  the result generated by the mapping rules falls
afoul of clause 1.4 of the Schema Component Constraint: Derivation Valid 
(Extension) and thus is not a conforming component.

This is one of the cases covered by the note in section 3.4.1 which
begins 

  Not all combinations of {derivation method} and {content type} 
  are compatible with all properties of the {base type definition}.

We considered adding another note in the appropriate clause (4.2.1)
of the mapping rule in 3.4.2.3.3, but (a) some were nervous about
getting the exact wording of such a note right (is it invariably the
case that if clause 4.2.1 fires, the result will violate a constraint
on schemas?  we thought so, briefly, but decided not), and (b) there are
several other places where the mapping rules produce results which violate
constraints on schemas; this is a consequence of making certain that the
constraints on the XML representation of schemas are wherever possible
testable against the XML in isolation.

The end result is that we believe this issue should be classed as
WORKSFORME.

Michael, if you are willing to live with this resolution, please so indicate
by closing the issue; if not, please prepare for a difficult argument 
within the WG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23833</commentid>
    <comment_count>2</comment_count>
    <who name="Tobias Koenig">tobias.koenig</who>
    <bug_when>2009-02-19 18:20:11 +0000</bug_when>
    <thetext>*** Bug 6600 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>