<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd"
	    xmlns:test="http://www.codesynthesis.com/xmlns/test"
            targetNamespace="http://www.codesynthesis.com/xmlns/test">

  <!--

    Various weird group combinations.

  -->

  <!-- case 1 -->

  <xsd:group name="g1">
    <xsd:sequence>
      <xsd:element name="e1" type="xsd:string"/>
      <xsd:element name="e2" type="xsd:long"/>
    </xsd:sequence>
  </xsd:group>

  <xsd:complexType name="Type1">
    <xsd:sequence>
      <xsd:group ref="test:g1"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- case 2 -->

  <xsd:group name="g2">
    <xsd:sequence>
      <xsd:element ref="test:g2e1"/>
    </xsd:sequence>
  </xsd:group>

  <xsd:complexType name="TypeTwo">
    <xsd:sequence>
      <xsd:group ref="test:g2"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="g2e1" type="xsd:string"/>

 <!-- case 3 -->

  <xsd:complexType name="Type3">
    <xsd:sequence>
      <xsd:group ref="test:g3"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:group name="g3">
    <xsd:sequence>
      <xsd:element ref="test:g3e1"/>
    </xsd:sequence>
  </xsd:group>

  <xsd:element name="g3e1" type="xsd:string"/>

 <!-- case 4 -->

  <xsd:complexType name="Type4A">
    <xsd:sequence>
      <xsd:group ref="test:g4" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="Type4B">
    <xsd:sequence minOccurs="0">
      <xsd:group ref="test:g4"/>
    </xsd:sequence>
  </xsd:complexType>


 <xsd:group name="g4">
    <xsd:sequence>
      <xsd:element name="e1" type="xsd:string"/>
      <xsd:element name="e2" type="xsd:long" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:group>

  <xsd:complexType name="Type4C">
    <xsd:sequence>
      <xsd:group ref="test:g4" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- case 5 -->

  <xsd:group name="g5-1">
    <xsd:choice>
      <xsd:group ref="test:g5-2"/>
      <xsd:element name="e1" type="xsd:string"/>
    </xsd:choice>
  </xsd:group>

  <xsd:group name="g5-2">
    <xsd:choice>
      <xsd:group ref="test:g5-3"/>
      <xsd:element name="e2" type="xsd:string"/>
    </xsd:choice>
  </xsd:group>

  <xsd:group name="g5-3">
    <xsd:choice>
      <xsd:element name="e3" type="xsd:long"/>
    </xsd:choice>
  </xsd:group>

  <xsd:complexType name="Type5">
    <xsd:choice>
      <xsd:group ref="test:g5-1"/>
    </xsd:choice>
  </xsd:complexType>

  <!-- case 6 -->

  <xsd:group name="g6-3">
    <xsd:choice>
      <xsd:group ref="test:g6-1"/>
      <xsd:element name="e_3_1" type="xsd:string"/>
      <xsd:element name="e_3_2" type="xsd:string"/>
    </xsd:choice>
  </xsd:group>

  <xsd:complexType name="Type6">
    <xsd:choice>
      <xsd:group ref="test:g6-2"/>
    </xsd:choice>
  </xsd:complexType>

  <xsd:group name="g6-2">
    <xsd:choice>
      <xsd:group ref="test:g6-3"/>
      <xsd:element name="e_2_1" type="xsd:string"/>
      <xsd:element name="e_2_2" type="xsd:string"/>
    </xsd:choice>
  </xsd:group>

  <xsd:group name="g6-1">
    <xsd:choice>
      <xsd:element name="e_1_1" type="xsd:string"/>
      <xsd:element name="e_1_2" type="xsd:string"/>
    </xsd:choice>
  </xsd:group>

</xsd:schema>
