Complex content extension

Hi all,

I would like to have clarifications about complex content extension 
attributes. 

I read in the book "Definitive XML Schema" that complex content extensions
"cannot modify or remove existing attributes". I found the same kind of 
statement in another book: "Professional XML Schemas".

I tried to find the paragraph that explains this behaviour in the 
Recomendation, but I haven't managed to get it. However, I found a paragraph
that introduced doubt about my understanding of those complex content 
extensions:

3.4.6 Constraints on Complex Type Definition Schema Components
[...]
Schema Component Constraint: Derivation Valid (Extension) 

If the {derivation method} is extension, the appropriate case among the following must be true:
1 If the {base type definition} is a complex type definition, then all of the following must be true:
1.1 The {final} of the {base type definition} must not contain extension. 
1.2 Its {attribute uses} must be a subset of the {attribute uses} of the complex type definition itself, that is, for every attribute use in the {attribute uses} of the {base type definition}, there must be an attribute use in the {attribute uses} of the complex type definition itself whose {attribute declaration} has the same {name}, {target namespace} and {type definition} as its attribute declaration.
[...]

Using the book and the Recommandation text, I deduced that the following 
schema should be invalid but but according to SQC and XSV it is not.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:complexType name="foo">
    <xsd:attribute name="a" type="xsd:boolean" use="optional"/>
  </xsd:complexType>

  <xsd:complexType name="bar">
    <xsd:complexContent>
      <xsd:extension base="foo">
        <xsd:attribute name="a" type="xsd:boolean" use="required"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="bar-2">
    <xsd:complexContent>
      <xsd:extension base="foo">
        <xsd:attribute name="a" type="xsd:boolean" use="prohibited"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

Can you help me to understand these complex content extension stuff?

Thanks,

Michael.

--
Michaël Marchegay, Stagiaire France Telecom R&D du 11/02/2002 au 26/07/2002
Sous la responsabilité d'Olivier Dubuisson
DTL/TAL - 22307 Lannion Cedex - France

Received on Tuesday, 6 August 2002 05:34:57 UTC