W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2006

extension adds element removed by restriction (3.4.6/1.5)

From: Moog, Thomas H <thomas.h.moog@intel.com>
Date: Mon, 23 Oct 2006 09:59:06 -0400
Message-ID: <93EBD06E7FC53940A911468FF9BBAD7D9FA609@hdsmsx412.amr.corp.intel.com>
To: <xmlschema-dev@w3.org>


In 3.4.6 (Constraints on Complex Type Definition Schema
Components) Section 1.5 there is this comment:

    Note: This requirement ensures that nothing removed by a
    restriction is subsequently added back by an extension.

The following schema is accepted by three schema validators.
I would expect gamma to be rejected because it adds back
element "b" which was removed when beta was created
from alpha.

I would appreciate it if someone would explain why this
does not violate 3.4.6 section 1.5.

Thanks.

<xs:complexType name="alpha">
  <xs:sequence>
     <xs:element name="a" />
     <xs:element name="b" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
 
<xs:complexType name="beta" >
  <xs:complexContent>
    <xs:restriction base="alpha" >
      <xs:sequence>
        <xs:element name="a" />
      </xs:sequence>
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>
 
<xs:complexType name="gamma" >
  <xs:complexContent>
    <xs:extension base="beta" >
      <xs:sequence>
        <xs:element name="b" />
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
Received on Monday, 23 October 2006 13:59:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT