[Bug 5943] New: ComplexContent extending SimpleContent

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

           Summary: ComplexContent extending SimpleContent
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: cmsmcq@w3.org
        ReportedBy: mike@saxonica.com
         QAContact: www-xml-schema-comments@w3.org


Consider the pathological test case particlesZ031 in the Microsoft part of the
test suite

  <xs:complexType name="Type1">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Field1" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="Type2">
    <xs:complexContent>
      <xs:extension base="Type1">
        <xs:attribute name="Field2" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

In Schema 1.0 the {content type} of Type2 is computed as follows:

1. The effective mixed is false

2. The effective content is empty

3.2.1 Therefore the {content type} is the {content type} of the base type
definition, namely SIMPLE.

Clearly this is perverse since the type specifies complexContent, but that's
what the rules say.

In 1.1 the effect is different (section 3.4.2.3.3).

1. The effective mixed is false

2. The effective content is empty

3. The explicit content is empty

4.2.1 applies, and takes us to 4.1.1, giving an explicit content type of
(empty, absent, absent, absent)

5. The wildcard element is absent

6. The {content type} is the explicit content type, namely (empty, absent,
absent, absent)

So this time we have complex (empty) content, which means that by extending a
type that allows string content we have created a type that allows no content
at all.

I think this case should simply be banned: a type with <complexContent> should
not be allowed to extend a base type with variety=simple.


-- 
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 Thursday, 7 August 2008 21:52:48 UTC