W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

RE: restrictions with nested simpleTypes.

From: Jason Diamond <jason@injektilo.org>
Date: Sun, 10 Dec 2000 20:39:31 -0800
To: "Martin Gudgin" <marting@develop.com>, <xmlschema-dev@w3.org>
Message-ID: <LAEMKGDBDFAKFNKPFEKLGECCCPAA.jason@injektilo.org>
Thanks for piquing my interest in unions.

> <simpleType name="allNNI">
>   <annotation><documentation xml:lang="en">
>    for maxOccurs</documentation></annotation>
>   <union memberTypes="nonNegativeInteger">
>    <simpleType>
>     <restriction base="NMTOKEN">
>      <enumeration value="unbounded"/>
>     </restriction>
>    </simpleType>
>   </union>
>  </simpleType>

Section 5.1.3 of the Datatypes spec says, "Either the memberTypes
[attribute] must be non-empty or there must be at least one simpleType
[child]." The documentation for the union element in the datatypes schema
has a similar comment. Your example above (which I also found in the schema
for schemas) seems to be violating this constraint.

Curiously, Section 2.5.1.3 of the Datatypes spec shows a different example
which it claims comes from the "XML Schema itself".

  <attributeGroup name="occurs">
    <attribute name="minOccurs"
      type="nonNegativeInteger" use="default" value="1"/>
    <attribute name="maxOccurs">
      <simpleType>
        <union>
          <simpleType>
            <restriction base='nonNegativeInteger'/>
          </simpleType>
          <simpleType>
            <restriction base='string'>
              <enumeration value='unbounded'/>
            </restriction>
          </simpleType>
        </union>
      </simpleType>
    </attribute>
  </attributeGroup>

This example looks correct according to my interpretation.

But I guess my real question is this: Why aren't the examples in the
datatypes spec and the actual declarations in the Schema for Schemas in
sync? Does this mean you're not using a cutting edge XInclude implementation
to suck in the examples from the schema into the spec every time you
"build"?

Shame on you guys. :-)

Jason.
Received on Sunday, 10 December 2000 23:43:15 GMT

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