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

Complex content extension

From: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN <michael.marchegay@rd.francetelecom.com>
Date: Tue, 6 Aug 2002 11:34:49 +0200
Message-ID: <0489A7888F080B4BA73B53F7E145F29A197C91@LANMHS20.rd.francetelecom.fr>
To: <xmlschema-dev@w3.org>

Hi all,

I would like to have clarifications about complex content extension 

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 

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 name="bar">
      <xsd:extension base="foo">
        <xsd:attribute name="a" type="xsd:boolean" use="required"/>

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

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



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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:04 UTC