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

Re: Multiple Inheritance in XML Schema

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 16 Dec 2002 11:06:17 +0000
To: Hans Teijgeler <Hans.Teijgeler@inter.nl.net> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>)
Cc: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Message-ID: <f5bd6o26x5i.fsf@erasmus.inf.ed.ac.uk>

Hans Teijgeler <Hans.Teijgeler@inter.nl.net> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>) writes:

> 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.

As it stands, W3C XML Schema type derivation does not support multiple
inheritance.

<snip/>

> 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 only available workaround, to use named attribute groups, does not
give you the derivation ('subtype') relations you desire, sorry.

> 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).

This isn't (yet) a good reason for needing multiple inheritance, since
the usage you describe won't work with key/keyref field or selector
paths, since they are interpreted per XPath 1.0 which does not know
about substitution groups or type-based matching.  With XPath 2.0, the
situation may change for the better in this regard.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Monday, 16 December 2002 06:06:13 GMT

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