[Bug 6644] New: Context determined type table

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6644

           Summary: Context determined type table
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: David_E3@VERIFONE.com
        ReportedBy: hrennau@yahoo.de
         QAContact: www-xml-schema-comments@w3.org
                CC: cmsmcq@blackmesatech.com


The definition of "context determined type table" uses an "effective type
table" - constructed from {type definition} - if the Element Declaration D has
no {type table}. The application of this definition in Conditional Type
Substitutable in Restriction (§3.4.4.5) has an inacceptable effect:

Let T1 be a complex type definition which contains a wildcard matched by one or
more global Element Declarations without {type table}. Then any type T2 derived
from T1 which contains a local Element Declaration overriding one of those
Element Declarations matching the wildcard is likely to make any element
validated against it invalid, if only that element contains a child element
whose name matches the overriding Element Declaration.

This follows from 3.4.4.2, clause 7, that is, the application of "Conditional
Type Substitutable in Restriction" to that child element. If the local element
declaration contains a type table, the element is invalid because it violates
Element Declarations Consistent (§3.8.6.3); if it does not contain an element
declaration, application of Conditional Type Substitutable in Restriction
(§3.4.4.5) will probably result in ST != SB.

This is illustrated by the following example schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="e2" type="t2"/>
  <xs:element name="b" type="xs:integer"/>

  <xs:complexType name="t1">
    <xs:sequence>
      <xs:element name="a" type="xs:string"/>
      <xs:any processContents="skip"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="t2">
    <xs:complexContent>
      <xs:extension base="t1">
        <xs:sequence>
          <xs:element name="b" type="xs:date"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>

Any element validated against Element Declaration e2 will be invalid, because
applying "Conditional Type Substitutable in Restriction" to child element b
(with T=t2, B=t1) yields:
ST = xs:date
SB = xs:integer


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 2 March 2009 07:36:22 UTC