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"
            id="complexType">
  <xs:annotation>
     <xs:documentation
       source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/>
  </xs:annotation>
</xs:element>

And the xs:topLevelComplexType is defined as:

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

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

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 16 January 2002 11:10:13 GMT

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