Nicolas Mailhot wrote:
But before I complain
about it I'd like to be dead-sure it's not allowed - if it were my own xsd
this would be different.
I have had a look through
http://www.w3.org/TR/xmlschema-1/#Co...pe_Definitions
and can't find anything in there suggesting that the name attribute on
xs:complexType is only allowed in certain cases or disallowed in other
cases.
However both Xerces Java as well as MSXML complain about that case and
indeed the schema for schemas says for topLevelComplex Type
<xs:complexTy pe name="topLevelC omplexType">
<xs:complexCont ent>
<xs:restricti on base="xs:comple xType">
<xs:sequence>
<xs:element ref="xs:annotat ion" minOccurs="0"/>
<xs:group ref="xs:complex TypeModel"/>
</xs:sequence>
<xs:attribute name="name" type="xs:NCName " use="required"/>
<xs:anyAttribut e namespace="##ot her" processContents ="lax"/>
</xs:restriction>
</xs:complexConte nt>
so there the name attribute is required while for localComplexTyp e
<xs:complexTy pe name="localComp lexType">
<xs:complexCont ent>
<xs:restricti on base="xs:comple xType">
<xs:sequence>
<xs:element ref="xs:annotat ion" minOccurs="0"/>
<xs:group ref="xs:complex TypeModel"/>
</xs:sequence>
<xs:attribute name="name" use="prohibited "/>
<xs:attribute name="abstract" use="prohibited "/>
<xs:attribute name="final" use="prohibited "/>
<xs:attribute name="block" use="prohibited "/>
<xs:anyAttribut e namespace="##ot her" processContents ="lax"/>
</xs:restriction>
</xs:complexConte nt>
</xs:complexType>
the name attribute is prohibited.
So you should complain if someone sends you a schema with
<xs:element name="element-name">
<xs:complexTy pe name="type-name">
as the name attribute on the local complex type is prohibited thus the
schema is not valid.
--
Martin Honnen
http://JavaScript.FAQTs.com/