Using global elements

All elements within the internal schema must be defined as global elements.

Element definitions must not appear within a complex type definition. For example, the following is not permitted:
<xsd:complexType name="Part">
  <xsd:sequence>
    <xsd:element name="partName" type="xsd:string"/>
    <xsd:element name="partDescription" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>
However, complex types can contain <xsd:element> tags if they use the "ref=" attribute instead of the "name=" attribute to refer to elements defined globally. So, the preceding example can be corrected as follows:
<xsd:element name="partName" type="xsd:string"/>
<xsd:element name="partDescription" type="xsd:string"/>
<xsd:complexType name="Part">
  <xsd:sequence>
    <xsd:element ref="MyExampleSpec:partName"/>
    <xsd:element ref="MyExampleSpec:partDescription"/>
  </xsd:sequence>
</xsd:complexType>