attribute required in base type/prohibited in derived type

Hello,

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:complexContent>
  <xsd:restriction base="xsd:anyType" >
     <xsd:attribute name = "A2" type="xsd:string" use="required"/>
  </xsd:restriction>
   </xsd:complexContent>
</xsd:complexType>

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

     </xsd:extension>
   </xsd:complexContent>
</xsd:complexType>

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

</xsd:schema>

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