Schema Component Constraint: Element Declarations Consistent

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 UTC