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

Re: Unnamed type in <schema>

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 16 Jan 2002 16:10:06 +0000
Message-ID: <192804747665.20020116161006@jenitennison.com>
To: sylvain.devillers@philips.com
CC: xmlschema-dev@w3.org
Hi Sylvain,

> Apparently, the "name" attribute of a type definition is optional,
> even if the type is defined under <schema>.

Admittedly it takes a bit of trawling to find out, but I don't think
the name attribute is optional on top-level xs:complexType elements.
Under the Schema Representation Constraint: Complex Type Definition
Representation OK in Section 3.4.3 it says:

  "In addition to the conditions imposed on <complexType> element
   information items by the schema for schemas, all of the following
   must be true:..."

Looking at the schema-for-schemas, you find that xs:complexType
elements directly under xs:schema elements are declared with:

<xs:element name="complexType" type="xs:topLevelComplexType"

And the xs:topLevelComplexType is defined as:

<xs:complexType name="topLevelComplexType">
    <xs:restriction base="xs:complexType">
        <xs:element ref="xs:annotation" minOccurs="0"/>
        <xs:group ref="xs:complexTypeModel"/>
      <xs:attribute name="name" type="xs:NCName" use="required"/>

As you can see, the name attribute is *required* on these
xs:complexType elements.



Jeni Tennison
Received on Wednesday, 16 January 2002 11:10:13 UTC

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