W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

attribute required in base type/prohibited in derived type

From: Tom Moog <tmoog@sarvega.com>
Date: Fri, 26 Apr 2002 12:32:46 -0500
Message-ID: <3CC98F3E.966EA847@sarvega.com>
To: xmlschema-dev@w3.org


Both MSV -strict and SQC accept the following complex types, but
I don't understand why attribute A2 can be required in a base type,
and prohibited in a derived type, and still satisfy the requirement that

all  derived types should be compatible with the base type.

Obviously, I'm missing something.

P.S. Replacing "extension" with "restriction" in the derived type
doesn't make any difference: both processors still accept it.

Tom Moog

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

<xsd:complexType name="base">
  <xsd:restriction base="xsd:anyType" >
     <xsd:attribute name = "A2" type="xsd:string" use="required"/>

<xsd:complexType name="derived">
      <xsd:extension base="base">
         <xsd:attribute name = "A2" type="xsd:string" use="prohibited"/>


<xsd:element name="derived" type="derived" />
<xsd:element name="base" type="base" />

Received on Friday, 26 April 2002 13:34:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:56 UTC