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

Is this derivation correct (in schema for schemas)?

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Sun, 11 Aug 2002 15:56:22 -0400 (EDT)
To: xmlschema-dev@w3.org
Message-ID: <25544.1029095749@www3.gmx.net>




Hi all,

in the schema for schemas the complexType "all" is derived from the
complexType "explicitGroup" by restriction. The content models of these two types are
as follows:

base:

<sequence minOccurs="1" maxOccurs="1">
    <element name="annotation" minOccurs="0" maxOccurs="1"/>
    <choice minOccurs="0" maxOccurs="unbounded">
        <element name="element" minOccurs="1" maxOccurs="1"/>
        <element name="group" minOccurs="1" maxOccurs="1"/>
        <element name="choice" minOccurs="1" maxOccurs="1"/>
        <element name="sequence" minOccurs="1" maxOccurs="1"/>
        <element name="any" minOccurs="1" maxOccurs="1"/>
    </choice>
</sequence>

restriction:

<sequence minOccurs="1" maxOccurs="1">
    <element name="annotation" minOccurs="0" maxOccurs="1"/>
    <element name="element" minOccurs="0" maxOccurs="unbounded"/>
</sequence>

The restriction looks valid but the rules for validating an element as a
restriction of a choice group demands that the element is a valid restriction of
one of the particles in the choice group. This is not the case in the above
example because of the occurence constraints! (maxOccurs is unbounded in the
restricting element.)

Maybe another normalization step (like replacing possible substitutions by
choices removing pointless groups) is needed for adjusting occurence
constraints?

--Stefan
Received on Tuesday, 13 August 2002 12:01:18 GMT

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