<?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>4467</bug_id>
          
          <creation_ts>2007-04-13 15:16:07 +0000</creation_ts>
          <short_desc>Context determined type for complex type with simple content</short_desc>
          <delta_ts>2009-04-21 19:21:46 +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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://lists.w3.org/Archives/Member/w3c-xml-schema-wg/2007Apr/0010.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sandy Gao">sandygao</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <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>14722</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-04-13 15:16:07 +0000</bug_when>
    <thetext>&lt;xs:complexType name=&quot;B&quot; mixed=&quot;true&quot;&gt;
  &lt;xs:sequence&gt;
    &lt;xs:element name=&quot;e&quot; type=&quot;xs:int&quot; minOccurs=&quot;0&quot;/&gt;
  &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;

&lt;xs:complexType name=&quot;R&quot;&gt;
  &lt;xs:simpleContent&gt;
    &lt;xs:restriction base=&quot;B&quot;&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base=&quot;xs:string&quot;/&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleContent&gt;
&lt;/xs:complexType&gt;

The CDT for &quot;e&quot; in &quot;B&quot; is &quot;xs:int&quot;. What&apos;s the CDT for &quot;e&quot; in &quot;R&quot;. 
Currently it&apos;s &quot;absent&quot;. Question: should it also be &quot;xs:int&quot; (i.e. 
inherit from &quot;B&quot;)?

Some WG members, during the F2F, felt that it should inherit from &quot;B&quot;. 
This can be &quot;fixed&quot; by removing &quot;or CTD&apos;s {content type} has simple 
{variety}&quot;. This is where my Action item came from. We wanted to make sure 
such change wouldn&apos;t have any negative impact.

Because one can not derive from a complex type with simple content and add 
element children to it (i.e. go from simple content to complex content), 
whether simple content use absent or inherit doesn&apos;t make any difference 
in most cases. The only case it affects (that I can think of now) is the 
following. Consider the above complex types and the following instance:

&lt;p xsi:type=&quot;R&quot;&gt;
  &lt;e&gt;abc&lt;/e&gt;
&lt;/p&gt;

Obviously &lt;p&gt; is invalid, because &quot;R&quot; has simple content and doesn&apos;t allow 
&lt;e&gt;. But what happens to &lt;e&gt;?

If &quot;R&quot; uses &quot;absent&quot; as CDT for &lt;e&gt;, then as a consequence &lt;e&gt; doesn&apos;t 
have a governing type definition. It will be laxly assessed using 
xs:anyType.

But if &quot;R&quot; inherits CDT from &quot;B&quot;, then &lt;e&gt; has xs:int as its CDT and 
governing type, and will be flagged invalid because its content &quot;abc&quot; is 
not a valid int.

Which is the right behavior? (I&apos;m leaning a little toward inherit. i.e. 
make the change suggested by this action item.)

[1] 
http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html#key-cdt
[2] http://www.w3.org/XML/Group/2007/01/xml-schema-ftf-minutes#fripm.vm3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15648</commentid>
    <comment_count>1</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-06-27 13:42:40 +0000</bug_when>
    <thetext>The WG discussed this issue at 2007-06-27 F2F meeting, and decided to remove &quot;or CTD&apos;s {content type} has simple {variety}&quot;, which effectively says that context determined type is always inherited by derived types.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16011</commentid>
    <comment_count>2</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-08-02 00:11:14 +0000</bug_when>
    <thetext>The repair agreed on in June has been included in the current status-quo
version of the spec at http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html

So I&apos;m changing this from &apos;decided&apos; to &apos;resolved&apos;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>