W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

Multiple Inheritance in XML Schema

From: by way of <Hans.Teijgeler@inter.nl.net>
Date: Tue, 19 Nov 2002 11:29:01 -0500
Message-Id: <5.1.0.14.1.20021119112858.01bc2a28@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>


Dear All,

We are working on what we call <www.infowebml.htm>InfowebML, offically to 
be called ISO 15926-7, in which we standardize data exchange and (lifetime) 
data integration on the basis of the data model defined in 
<http://www.matthew-west.org.uk/iso15926-2/>ISO 15926-2.

In that data model, written in EXPRESS, we see entity types that are the 
subtype of more than one other entity type, i.e. we have multiple 
(attribute) inheritance. We have represented the entire data model in XML 
Schema, with one exception: that multiple inheritance, because it appears 
to us that XML Schema cannot handle that.

Let me give a simple example of impossible code (because of the double 
extension):

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
xmlns:xs="<http://www.w3.org/2001/XMLSchema>http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:complexType name="parent_1">
            <xs:attribute name="attribute_p1-1" type="xs:string" 
use="required"/>
            <xs:attribute name="attribute_p1-2" type="xs:boolean" 
use="optional"/>
      </xs:complexType>
      <xs:complexType name="parent_2">
            <xs:attribute name="attribute_p2-1" type="xs:decimal" 
use="optional"/>
            <xs:attribute name="attribute_p2-2" type="xs:integer" 
use="required"/>
      </xs:complexType>
      <xs:complexType name="child">
            <xs:complexContent>
                  <xs:extension base="parent_1"/>
                  <xs:extension base="parent_2"/>
            </xs:complexContent>
      </xs:complexType>
</xs:schema>

I seek a workaround for this problem, that not only allows me to inherit 
all 2+2 attributes, but also let 'child' be a true subtype of both 
'parent_1' AND of           'parent_2'.

The latter is important in cases where a key-keyref Identity Constraint in 
the XML Schema 'refer's to, for example, 'parent_2' and where in the 
derived XML file reference is made to an instance of 'child' (which should 
pass validation).

Can anyone help me?

Regards,
Hans Teijgeler, Fluor Corp. 
Received on Tuesday, 19 November 2002 11:40:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT