another restriction question

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
particles.

Base type:

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

Derived type:

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

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?

Thanks,

calvin

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