<?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>5079</bug_id>
          
          <creation_ts>2007-09-26 01:44:57 +0000</creation_ts>
          <short_desc>Type tables and substitution groups</short_desc>
          <delta_ts>2008-02-10 02:06:21 +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>Macintosh</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/</bug_file_loc>
          <status_whiteboard>medium, work, clarification cluster</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xan Gregg">xan.gregg</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>16796</commentid>
    <comment_count>0</comment_count>
    <who name="Xan Gregg">xan.gregg</who>
    <bug_when>2007-09-26 01:44:57 +0000</bug_when>
    <thetext>It seems that type tables aren&apos;t used in the definition of type derivation or substitutability, allowing for valid substitutions that subvert the type constraints. For example,

&lt;xs:element name=&quot;message&quot; type=&quot;messageType&quot;&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;string&apos;&quot; type=&quot;messageTypeString&quot;/&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;base64&apos;&quot; type=&quot;messageTypeBase64&quot;/&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;binary&apos;&quot; type=&quot;messageTypeBase64&quot;/&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;xml&apos;&quot;    type=&quot;messageTypeXML&quot;/&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;XML&apos;&quot;    type=&quot;messageTypeXML&quot;/&gt;
&lt;/xs:element&gt;

&lt;xs:element name=&quot;mixed_message&quot; type=&quot;messageType&quot; substitutionGroup=&quot;message&quot;&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;string&apos;&quot; type=&quot;messageTypeXML&quot;/&gt;
  &lt;xs:alternative test=&quot;@kind=&apos;binary&apos;&quot; type=&quot;messageTypeString&quot;/&gt;
&lt;/xs:element&gt;

Is this a problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18158</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-12-27 00:45:41 +0000</bug_when>
    <thetext>Thank you for the comment.

There seem to be two possible answers to your question.  The first is:  no,
there is no problem.  At least, there is no logical contradiction here.

The rules for substitutability require a particular relation between the 
declared type of the substitution-group head and the declared types of the 
members of its substitution group.  It is true that particular instances of the
head and particular instances of the substitution-group members may have 
different types -- in 1.0 this is possible by means of xsi:type, and in 1.1
it is possible both by means of xsi:type and by means of conditional type
assignment.  The guarantee that schema validity gives relates to 
the declared type; this has consequences for the governing types of the
element instances involved, but it does not have the consequence that there
is any substitutability relation between the governing types of different
element instances which match the same particle, only that there is a
substitutability relation between the governing types and the declared type
given in the particle.

A second answer would just turn the question around:  the schema spec makes
a given guarantee.  Is that guarantee sufficient for users&apos; needs (in
particular, yours)?  Or is it a problem?  If it&apos;s not a problem for users
of XSDL, then it&apos;s not a problem.  If it&apos;s a problem for a sufficiently
large number of them, then it may be a problem.  But that is for you to say,
not for the WG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18175</commentid>
    <comment_count>2</comment_count>
    <who name="Xan Gregg">xan.gregg</who>
    <bug_when>2008-01-01 22:43:31 +0000</bug_when>
    <thetext>I know of no user problems -- just making sure this is not an oversight.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18559</commentid>
    <comment_count>3</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2008-01-25 20:04:54 +0000</bug_when>
    <thetext>After discussing this issue, the WG believes that the current design handles the significant cases.  As always, thank you for your careful reading of our work, Xan.

Please let us know if you agree with this resolution of your issue, by adding a comment to the issue record and changing the Status of the issue to Closed. Or, if you do not agree with this resolution, please add a comment explaining why. If you wish to appeal the WG&apos;s decision to the Director, then also change the Status of the record to Reopened. If you wish to record your dissent, but do not wish to appeal the decision to the Director, then change the Status of the record to Closed. If we do not hear from you in the next two weeks, we will assume you agree with the WG decision.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18956</commentid>
    <comment_count>4</comment_count>
    <who name="Xan Gregg">xan.gregg</who>
    <bug_when>2008-02-10 02:06:21 +0000</bug_when>
    <thetext>I disagree with the resolution but will not appeal.

The unconstrained combination of type tables and substitution groups violates the spirit of valid derivation in the substitution group tree. I assume the WG is aware of this violation and considers the intersection of these two features to not be a &quot;significant case.&quot;

It will be dangerous to combine the two features, and any examples of elements with type tables in future editions of XSD 1.1 should block substitution. </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>