OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: XML Schemas: <all> + extension = ?

[ Lists Home | Date Index | Thread Index ]
  • From: Rick JELLIFFE <ricko@geotempo.com>
  • To: xml-dev@xml.org
  • Date: Mon, 10 Jul 2000 18:55:37 +0800

"Henry S. Thompson" wrote:
> Can't be done as the design stands.  Derived types observe one of two
> invariants:
> restriction) all members of derived type are members of base type
> extension) all members of derived type contain members of base type as
>            a prefix.

Note that "prefix" here is not anything to do with the namespace prefix.
Roughly it means that a complex type derived by extension has the
declarations take from the base first (i.e., the prefix) then the new
declarations (i.e., the suffix). 

Programmers will see that this constraint makes implementation simple:
the derived-by-extension type can use the classes or structures created
for the base type without change. For example, the class/struct
implementing the derived type could simply have an object/pointer of the
class/struct implementing the base type as a member; or every class
implementing a base type could have a member/pointer in which extensions
could be chained.  (In some languages, the class implementing the base
class could be simply subclassed to add slots/accessors for the new

Another result of this are that if I compile the XML Schema for a
complex type into record-like structures accessed by byte-offset, then
the same offsets would work with types and derived types. (Of course,
the more complex the content model, the less this is useful: but
certainly it can be useful for accessing attributes and flat content
models with fixed occurences.)  Certainly one of the hopes of XML
Schemas is to allow schemas with declarations (at least closed
declarations) to be compilable into very efficient forms for
database-like access.

It may well be that with experience we find that the
extensions-are-suffixes rule is not necessary for efficiency; until this
can be conclusively ruled out, limiting extension to "suffixation" is
reasonable IMHO.

(B.T.W., has anyone released a good tutorial about type substituability
and XML Schemas?)

Rick Jelliffe

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS