<?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>2244</bug_id>
          
          <creation_ts>2005-09-14 19:43:20 +0000</creation_ts>
          <short_desc>R-252: Final/block, transitivity and restriction</short_desc>
          <delta_ts>2009-04-21 19:21:39 +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>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>medium, hard, restriction cluster</status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P4</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>6274</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-14 19:43:20 +0000</bug_when>
    <thetext>In certain cases, I&apos;m not sure the current REC makes the right call on when to 
do recursive checking up the base type chain and when not. 

Consider the following schema document: 

&lt;xs:schema&gt;
 &lt;xs:element name=&quot;root&quot; type=&quot;top&quot;/&gt;
 
 &lt;xs:complexType name=&quot;top&quot; final=&quot;restriction&quot;&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name=&quot;a&quot; minOccurs=&quot;0&quot;/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
 
 &lt;xs:complexType name=&quot;intermediate&quot;&gt;
  &lt;xs:complexContent&gt;
   &lt;xs:extension base=&quot;top&quot;&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element name=&quot;b&quot;/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:extension&gt;
  &lt;/xs:complexContent&gt;
 &lt;/xs:complexType&gt;
 
 &lt;xs:complexType name=&quot;bottom&quot;&gt;
  &lt;xs:complexContent&gt;
   &lt;xs:restriction base=&quot;intermediate&quot;&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element name=&quot;b&quot;/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:restriction&gt;
  &lt;/xs:complexContent&gt;
 &lt;/xs:complexType&gt;
 
 &lt;xs:complexType name=&quot;top2&quot;&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name=&quot;c&quot; type=&quot;top&quot;/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
 
 &lt;xs:complexType name=&quot;restrictOKorNot&quot;&gt;
  &lt;xs:complexContent&gt;
   &lt;xs:restriction base=&quot;top2&quot;&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element name=&quot;c&quot; type=&quot;bottom&quot;/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:restriction&gt;
  &lt;/xs:complexContent&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:schema&gt;

The constraints on type definitions do _not_ recurse up the chain when 
checking &apos;final&apos;, so the type def named &apos;bottom&apos; above is OK, despite 
restricting away an element (&apos;a&apos;) introduced in a type definition which says 
it&apos;s final for restriction. 

However, content model checking _does_ recurse up the chain, so the type defn 
named &apos;restrictOKorNot&apos; is _not_ OK. Neither is that following instance, wrt 
the schema corresponding to the above schema doc: 

&lt;root xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:type=&quot;bottom&quot;&gt;
 &lt;b/&gt;
&lt;/root&gt;

Is this really what we want? 

See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2004JanMar/0087.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13275</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-12-22 17:02:23 +0000</bug_when>
    <thetext>The WG agreed that the type RestrictOKorNot is not legal, and that it
should not be.  The chain of derivation from bottom to top has some
non-restriction steps, and that means it should not be OK to
substitute bottom for top in the restriction.

The WG decided to make no change here.  The originator of the
comment, Henry Thompson, agrees.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>