W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: Multiple extension ?

From: Bruno Chatel <bcha@chadocs.com>
Date: Wed, 11 Jul 2001 21:01:45 +0200
Message-ID: <0a9801c10a3b$f1646000$0600a8c0@chafou>
To: "Jeff Rafter" <jeffrafter@definedweb.com>, <xmlschema-dev@w3.org>
Cc: <bcha@chadocs.com>
Thank you for this idea, but it is not exactly the way i want to build
my schema. Indeed, in order to be conform with the global design of my schema,
 I really need to build tAllType by inheritance of t1Type and t2Type. 
In fact, t1Type and t2Type are complex types build by extension
from other types.... Then, the substitution group is not a correct
way to process. 
I need something like : 

<complexType name="tBaseType">
    <!-- content model -->
</>

<complexType name="t1Type">
    <complexContent>
        <extension base="tBaseType">
            <!-- extended content model -->
        </>
    </>
</>

<complexType name="t2Type">
    <complexContent>
        <extension base="tBaseType">
            <!-- extended content model -->
        </>
    </>
</>


I need something like this :
<complexType name="tAllType">
  <complexContent>
   <!--extension base  t1Type and t2Type -->
    <!-- extended content model -->
  </>
</>

Is it really impossible ? 

Thanks in advance.

Regards

-- bruno --
----------------------------------------
Bruno Chatel
Tel : (+33)[0] 4 96 11 14 57
Email : bcha@chadocs.com
http://www.chadocs.com
----------------------------------------

> I don't know of a way to do multiple inheritance with complexTypes
> explicitly but with simpleTypes you can use the union construct.  The way
> this type of thing is typically handled is to use named groups.  Something
> along these lines:
> 
>  <xs:schema>
> 
>    <xs:group name="t1Group">
>      <xs:sequence>
>        <xs:element name="foo"/>
>      </xs:sequence>
>    </xs:group>
> 
>    <xs:group name="t2Group">
>      <xs:sequence>
>        <xs:element name="bar"/>
>      </xs:sequence>
>    </xs:group>
> 
>    <xs:complexType name="t1Type">
>      <xs:sequence>
>        <xs:group ref="t1Group"/>
>      </xs:sequence>
>    </xs:complexType>
> 
>    <xs:complexType name="t2Type">
>      <xs:sequence>
>        <xs:group ref="t2Group"/>
>      </xs:sequence>
>    </xs:complexType>
> 
>    <xs:complexType name="tAllType">
>      <xs:sequence>
>        <xs:group ref="t1Group"/>
>        <xs:group ref="t2Group"/>
>      </xs:sequence>
>    </xs:complexType>
> 
>  </xs:schema>
> 
> Good Luck,
> Jeff Rafter
> Defined Systems
> http://www.defined.net
> XML Development and Developer Web Hosting
> 
> 
> 
> ----- Original Message -----
> From: "Bruno Chatel" <bcha@chadocs.com>
> To: <xmlschema-dev@w3.org>
> Cc: <bcha@chadocs.com>
> Sent: Wednesday, July 11, 2001 6:55 AM
> Subject: Multiple extension ?
> 
> 
> > Hi,
> > I am searching a way for declaring multiple extension in a complexType
> definition.
> > For example, if I have 2 complexTypes t1Type and t2Type defined, I would
> like
> > to define tAllType like an extension of t1Type and t2Type.
> > Sorry but I did not find a response to this .
> >
> > Thanks in advance;
> >
> > -- bruno --
> > ----------------------------------------
> > Bruno Chatel
> > Tel : (+33)[0] 4 96 11 14 57
> > Email : bcha@chadocs.com
> > ----------------------------------------
> >
> >
> >
> 
Received on Wednesday, 11 July 2001 14:56:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT