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

RE: extension adds element removed by restriction (3.4.6/1.5)

From: Moog, Thomas H <thomas.h.moog@intel.com>
Date: Thu, 26 Oct 2006 01:12:45 -0400
Message-ID: <93EBD06E7FC53940A911468FF9BBAD7DA41856@hdsmsx412.amr.corp.intel.com>
To: <xmlschema-dev@w3.org>


Can someone give me an example of a sequence of
restrictions and extensions which *cannot* be
represented in the canonical form described in
Section 3.6 (that is, one restriction followed by
one extension (possibly empty), followed by one
restriction (possibly empty) ?

There is a rule which requires that all element
in a model group with the same name have the 
same type (Section 3.8.1).

In the case of complexType alpha with element
"b" of type xs:gYear and complexType gamma with
element "b" of type xs:integer, would this be
a violation of that rule ?  I suspect not as
alpha's "b" cannot be present when gamma's "b"
is present.


<xs:complexType name="alpha">
  <xs:sequence>
     <xs:element name="a" />
     <xs:element name="b" minOccurs="0" type="xs:gYear" />
  </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" type="xs:integer" />
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
Received on Thursday, 26 October 2006 05:13:01 GMT

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