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

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

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Kay writes:

> I've never been quite sure whether there is any theoretical 
justification
> for allowing this kind of extension of a content model and no other 
kind,
> but that's what the spec does. I assume it's by analogy with 
object-oriented
> inheritance which allows a subtype to have additional properties that 
were
> 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 
restriction.

ht
- -- 
       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 
spam]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFLRzeGkjnJixAXWBoRAvLxAJ9zVj7P1/CSC5V/gwrhNn0TDbGZKgCcCUcR
RxPMZtBSqh3gvagnNhwkFJ0=
=jBxa
-----END PGP SIGNATURE-----

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