W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2004

Is this schema valid?

From: Dare Obasanjo <dareo@microsoft.com>
Date: Wed, 17 Mar 2004 11:06:39 -0800
Message-ID: <830178CE7378FC40BC6F1DDADCFDD1D1021BDEE8@RED-MSG-31.redmond.corp.microsoft.com>
To: <xmlschema-dev@w3.org>

Is there any reason why myDCT is an invalid restriction of myCT?
Intuitively it seems it is not but there is verbiage that may imply that
it is.  


<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:complexType name="Person">
            <xs:sequence>
                        <xs:element name="FirstName" type="xs:string"/>
            </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Emp">
    <xs:complexContent>
            <xs:extension base="Person">
            <xs:sequence>
                        <xs:element name="LastName" type="xs:string"/>
            </xs:sequence>
            </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="myCT">
            <xs:sequence>
                        <xs:element name="Person" type="xs:anyType"/>
            </xs:sequence>
  </xs:complexType>

<xs:complexType name="myDCT">
    <xs:complexContent>
            <xs:restriction base="myCT">
            <xs:sequence>
                        <xs:element name="Person" type="Emp"/>
            </xs:sequence>
            </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>

--
PITHY WORDS OF WISDOM 
The first myth of management is that it exists.    

This posting is provided "AS IS" with no warranties, and confers no
rights. 
Received on Wednesday, 17 March 2004 14:07:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC