W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Re: substitutionGroup and anyType

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 12 Feb 2003 18:40:40 +0000
Message-ID: <97357279290.20030212184040@jenitennison.com>
To: "Hugh Wallis" <hugh_wallis@hyperion.com>
CC: xmlschema-dev@w3.org

Hi Hugh,

> Hmm - but at
> http://www.w3.org/TR/xmlschema-1/#Type_Definition_Summary it says:
>
> [Definition:] Except for a distinguished ·ur-type definition·, every
> ·type definition· is, by construction, either a ·restriction· or an
> ·extension· of some other type definition. The graph of these
> relationships forms a tree known as the Type Definition Hierarchy.

Yes. That's what I meant when I said that if you went by the "spirit"
of the rules, you'd say that it was legal to substitute xs:anyType
with xs:string.

However the legality of substitution groups is actually defined in
this case by Schema Component Constraint: Type Derivation OK (Simple),
which says:

  For a simple type definition (call it D, for derived) to be validly
  derived from a simple type definition (call this B, for base) given
  a subset of {extension, restriction, list, union} (of which only
  restriction is actually relevant) one of the following must be true:

  1 They are the same type definition.

  2 All of the following must be true:

    2.1 restriction is not in the subset, or in the {final} of its
        own {base type definition};

    2.2 One of the following must be true:

        2.2.1 D's ·base type definition· is B.

        2.2.2 D's ·base type definition· is not the ·simple
              ur-type definition· and is validly derived from B given
              the subset, as defined by this constraint.

        2.2.3 D's {variety} is list or union and B is the
              ·simple ur-type definition·.

        2.2.4 B's {variety} is union and D is validly derived
              from a type definition in B's {member type definitions}
              given the subset, as defined by this constraint.

and this falls down because none of the conditions from 2.2 are met:
xs:string is an atomic type whose base type definition is the simple
ur-type definition.

I'd view this as a bug in the spec, personally.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 12 February 2003 13:40:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT