<?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>2233</bug_id>
          
          <creation_ts>2005-09-14 19:34:45 +0000</creation_ts>
          <short_desc>R-241: Question re: Validation of an element restriction whose base type has the variety union</short_desc>
          <delta_ts>2009-04-21 19:21:38 +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></bug_file_loc>
          <status_whiteboard></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>6260</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-14 19:34:45 +0000</bug_when>
    <thetext>It seems to me that the the following schema should be invalid because the 
value space of the base type definition of the element &quot;e&quot; in the type &quot;ct-
base&quot; is not a super set of the value space of the base type definition of the 
element &quot;e&quot; in &quot;ct-deriv&quot;; but I cannot find any Schema Component Constraint 
invalidating it. 

&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;

  &lt;xs:simpleType name=&quot;base&quot;&gt;
    &lt;xs:union memberTypes=&quot;xs:boolean xs:integer&quot;/&gt;
  &lt;/xs:simpleType&gt;

  &lt;xs:simpleType name=&quot;deriv&quot;&gt;
    &lt;xs:restriction base=&quot;base&quot;&gt;
      &lt;xs:enumeration value=&quot;1&quot;/&gt;
      &lt;xs:enumeration value=&quot;2&quot;/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;

  &lt;xs:complexType name=&quot;ct-base&quot;&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name=&quot;e&quot; type=&quot;deriv&quot;/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;

  &lt;xs:complexType name=&quot;ct-deriv&quot;&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base=&quot;ct-base&quot;&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name=&quot;e&quot; type=&quot;xs:integer&quot;/&gt;
        &lt;/xs:sequence&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;

&lt;/xs:schema&gt;

Using cos-st-derived-ok [1], xs:integer seems to be validly derived given 
{extension, list, union} from deriv (because the member type definitions 
property of deriv is the the member type definitions of base). Therefore, 
rcase_NameAntTypeOK [2] is not violated, and the restriction seems to be valid. 

Comment originally posted to xmlschema-dev mail list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6261</commentid>
    <comment_count>1</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-14 19:34:54 +0000</bug_when>
    <thetext>See:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2003OctDec/0038.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11983</commentid>
    <comment_count>2</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-09-23 22:46:52 +0000</bug_when>
    <thetext>The problem identified here is the same as the one mentioned in
bug 2333; it has been addressed in XML Schema 1.1 by eliminating 
the practice of &apos;flattening&apos; union, thus ensuring that when a
union is restricted, its union-level facets are not lost when
it is named as a member of another union.  The same change addresses
the problem identified here, in which the union-level facets are lost
when restriction is checked.  Under the new rules, the restriction
of ct-base by ct-deriv is not legal, since the type assigned to
element e in ct-deriv is not a restriction of the type assigned
to that element in ct-base.

The original comment still applies to XML Schema 1.0, and I have
made a separate issue for 1.0 (bug 3763).

With the change to the treatment of unions, which is reflected in
the current published working draft, I believe this issue has been
resolved, so I am changing its status to RESOLVED / FIXED.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11984</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-09-23 23:09:23 +0000</bug_when>
    <thetext>For the record:  a response has been sent to Michael Marchegay, who
originally raised this issue (on xmlschema-dev) and to Alessandro
Triglia, who seconded the point and forwarded the mail to 
the schema comments list.  A copy of the response may be found
in the archive of the XML Schema comments list
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2006JulSep/0157.html </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>