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

Re: Multiple extension ?

From: Eddie Robertsson <eddie@allette.com.au>
Date: Thu, 12 Jul 2001 09:43:19 +1000
Message-ID: <3B4CE496.C5438491@allette.com.au>
To: Bruno Chatel <bcha@chadocs.com>
CC: Jeff Rafter <jeffrafter@definedweb.com>, xmlschema-dev@w3.org
Hi,

<snip/>

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

Yes, there is no way to do this in W3C XML Schema unless you can use the technique
suggested by Jeff. I'm not sure if other schema dialects support this but from
what I can understand W3C XML Schema is the only dialect to support type
inheritance (except for maybe SOX) so I think you need to find another solution to
your problem.

Cheers,
/Eddie

>
>
> 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 19:43:13 GMT

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