W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2010

Re: Extending "choice" model group in a xsd schema

From: <noah_mendelsohn@us.ibm.com>
Date: Fri, 8 Jan 2010 10:20:01 -0500
To: ht@inf.ed.ac.uk (Henry S. Thompson)
Cc: "'Jaikiran Pai'" <jai_forums2005@yahoo.co.in>, "Michael Kay" <mike@saxonica.com>, xmlschema-dev@w3.org
Message-ID: <OF48405D79.740404BA-ON852576A5.00540BC0-852576A5.00543BEB@lotus.com>
I think there was an intuition on the part of some members of the working 
group that extension would not only be similar in spirit to what is done 
for data inheritance in OO programming languages, but that it would 
facilitate serialization of such OO structures to XML.  I'm not saying I 
was entirely convinced of those arguments, in part because there are so 
many subtleties in what different languages really do (e.g. multiple 
inheritance in C++), but I think it's fair to say that this was a use case 
some WG members had in mind.


Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142

ht@inf.ed.ac.uk (Henry S. Thompson)
Sent by: xmlschema-dev-request@w3.org
01/08/2010 08:47 AM
        To:     "Michael Kay" <mike@saxonica.com>
        cc:     "'Jaikiran Pai'" <jai_forums2005@yahoo.co.in>, 
<xmlschema-dev@w3.org>, (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Re: Extending "choice" model group in a xsd schema

Hash: SHA1

Michael Kay writes:

> I've never been quite sure whether there is any theoretical 
> for allowing this kind of extension of a content model and no other 
> but that's what the spec does. I assume it's by analogy with 
> inheritance which allows a subtype to have additional properties that 
> not present in the supertype.

Yes.  The parallel with OO design was intentional, with the idea being
that just as many OO implementations handle type derivation in such a
way that a stack frame for an instance of a derived type is the
concatenation of a stack frame for its base type with extra slots for
additional local variable, so in XSD an instance of an extension-derived
type is a concatenation of an instance of the base type with
additional elements as allowed by the derived type.

This is sometimes referred to as the "prefix invariant", in contrast
with the "subsumption invariant" associated with derivation by 

- -- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
                         Half-time member of W3C Team
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged 
Version: GnuPG v1.2.6 (GNU/Linux)

Received on Friday, 8 January 2010 15:20:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:55 UTC