W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

another restriction question

From: Calvin Smith <calvins@SIMS.Berkeley.EDU>
Date: Wed, 24 Jul 2002 14:28:34 -0700 (PDT)
To: xmlschema-dev@w3.org
Message-ID: <Pine.GSO.4.44.0207241349430.10984-100000@info.sims.berkeley.edu>

I am trying to restrict a type that consists solely of an <xsd:any>
(inside <xsd:sequence>) element, without success.  Xerces2-J says that the
particle of the type is not a valid restriction of the particle of the
base, because there is not a complete functional mapping between the

Base type:

<xsd:complexType name="PayloadType">
  <xsd:sequence maxOccurs="unbounded">
    <xsd:any maxOccurs="unbounded"/>

Derived type:

<xsd:complexType name="LabelType">
    <xsd:restriction base="PayloadType">
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element name="LabelGraphic" type="cct:GraphicType"
minOccurs="0" maxOccurs="unbounded"/>
        <!-- other elements omitted -->

From the spec: [Definition:]  A complete functional mapping is
order-preserving if each particle r in the domain R maps to a particle b
in the range B which follows (not necessarily immediately) the particle in
the range B mapped to by the predecessor of r, if any, where "predecessor"
and "follows" are defined with respect to the order of the lists which
constitute R and B. [http://www.w3.org/TR/xmlschema-1/#rcase-Recurse]

My restriction does not qualify as a complete functional mapping, then,
since the second-to-last particle inside the restricted type's sequence
cannot be mapped to a predecessor of the base particle that is mapped to
by the last restricted particle.

Am I missing something obvious?  What I would like is to do type
substitution (without substitution groups) and have the base type such
that any kind of a restriction is a valid restriction.  I would like to
substitute types that don't necessarily have anything in common except
that they restrict the generic PayloadType (which is abstract) in some
way.  Is there a better way to do this than what I am trying to do?


Received on Wednesday, 24 July 2002 17:28:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC