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

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

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Fri, 08 Jan 2010 13:47:50 +0000
To: "Michael Kay" <mike@saxonica.com>
Cc: "'Jaikiran Pai'" <jai_forums2005@yahoo.co.in>, <xmlschema-dev@w3.org>
Message-ID: <f5bpr5kemih.fsf@calexico.inf.ed.ac.uk>
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.

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

Received on Friday, 8 January 2010 13:48:19 UTC

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