This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3763 - R-241: Question re: Validation of an element restriction whose base type has the variety union
Summary: R-241: Question re: Validation of an element restriction whose base type has ...
Status: NEW
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0 only
Hardware: Macintosh Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: unclassified
Depends on:
Blocks:
 
Reported: 2006-09-23 22:30 UTC by C. M. Sperberg-McQueen
Modified: 2012-12-04 00:51 UTC (History)
0 users

See Also:


Attachments

Description C. M. Sperberg-McQueen 2006-09-23 22:30:58 UTC
This issue is a twin of bug 2233; this copy is for XML Schema 1.0,
and bug 2233 is for XML Schema 1.1; I am separating the two since
they seem likely to have distinct dispositions.

The comment was first raised on the xmlschema-dev mailing list
by Michael Marchegay on 6 November 2003 
(http://lists.w3.org/Archives/Public/xmlschema-dev/2003Nov/0019.html);
a reply by Alessandro Triglia was cross-posted to www-xmlschema-comments
(http://lists.w3.org/Archives/Public/www-xml-schema-comments/2003OctDec/0038.html).
The words that follow are Marchegay's:

It seems to me that the the following schema should be invalid because the 
value space of the base type definition of the element "e" in the type 
"ct-base" is not a super set of the value space of the base type definition 
of the element "e" in "ct-deriv"; but I cannot find any Schema Component 
Constraint invalidating it. 

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:simpleType name="base">
    <xs:union memberTypes="xs:boolean xs:integer"/>
  </xs:simpleType>

  <xs:simpleType name="deriv">
    <xs:restriction base="base">
      <xs:enumeration value="1"/>
      <xs:enumeration value="2"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ct-base">
    <xs:sequence>
      <xs:element name="e" type="deriv"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ct-deriv">
    <xs:complexContent>
      <xs:restriction base="ct-base">
        <xs:sequence>
          <xs:element name="e" type="xs:integer"/>
        </xs:sequence>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>

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.

Have I missed something?

[1] http://www.w3.org/TR/xmlschema-1/#cos-ct-derived-ok
[2] http://www.w3.org/TR/xmlschema-1/#rcase-NameAndTypeOK