RE: Multiple inheritance

What Eddie says is correct.  
XML Schema type derivation only allows one "base" type.  

However, it is possible to simulate multiple inheritance in part using named
content model groups.  
You can build content models (either types or groups) by including
references to previously defined groups.  

The "pure" form of this would see all content models built as named groups,
then each XML Schema type definition would merely use a single group. 
Unfortunately this only works for element content, not attributes, and also
requires you to keep track of yet another meta-level in the schema - the
groups.  

But it can be done.  


> -----Original Message-----
> From: Eddie Robertsson [mailto:erobertsson@allette.com.au]
> Sent: Thursday, 29 August 2002 8:17 AM
> To: Mathieu DUBOS
> Cc: xmlschema-dev@w3.org
> Subject: Re: Multiple inheritance
> 
> 
> 
> Hi Mathiue,
> 
> > I'm looking for making a double inheritance and don't 
> manage doing so.
> > What I would like is that an element inherits attributes 
> from a first 
> > type defined in a xsd file, and also inherits attributes 
> from a second 
> > type defined in a second xsd file.
> >
> > I tried kind of things like :
> >
> >   <xs:complexType name="Type0">
> >     <xs:complexContent>
> >       <xs:extension base="dt1:DataType1">
> >         <xs:extension base="dt2:DataType2"/>
> >         <xs:attribute name="comment" type="xs:string" 
> use="required"/>
> >       </xs:extension>
> >     </xs:complexContent>
> >   </xs:complexType>
> >
> > but errors occur when i parse a xml instance with xerces-j.
> >
> > Someone could help me??
> 
> There's currently no way to do multiple inhertance in W3C XML Schema.
> 
> Cheers,
> /Eddie
> 
> >
> > thx a lot
> >
> > ----
> > Mathieu DUBOS
> >
> >
> >
> >
> 

Received on Thursday, 29 August 2002 01:46:29 UTC