W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2004

Schema Component Constraint: Element Declarations Consistent

From: Michael Kay <mhk@mhk.me.uk>
Date: Fri, 13 Feb 2004 16:43:03 -0000
To: <xmlschema-dev@w3.org>
Message-ID: <000001c3f250$782fa640$6401a8c0@pcukmka>

In the rule for consistency of element declarations within a model
group, why is it required that the type of an element that appears twice
be a named top-level type?

I read the rule as saying that the following is OK:

<complexType name="cType">
 <sequence>
  <element ref="a"/>
  <element ref="a"/>
 </sequence>
</complexType>

<element name="a" type="dType"/>

<complexType name="dType>
  <simpleContent base="xs:string"/>
</complexType>

But the following is not:

<complexType name="cType">
 <sequence>
  <element ref="a"/>
  <element ref="a"/>
 </sequence>
</complexType>

<element name="a">
 <complexType>
   <simpleContent base="xs:string"/>
 </complexType>
</element>

Is this reading correct, and if so, why the rule?

Michael Kay
Received on Friday, 13 February 2004 11:42:31 GMT

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