<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">

  <!-- Multiple levels of forward reference. -->

  <complexType name="type">
    <sequence>
      <group ref="t:g1" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <group name="g1">
    <choice>
      <group ref="t:g2" minOccurs="0"/>
      <group ref="t:g3" maxOccurs="unbounded"/>
    </choice>
  </group>

  <group name="g2">
    <choice>
      <element ref="t:foo2"/>
      <element ref="t:bar2" minOccurs="0"/>
    </choice>
  </group>

  <group name="g3">
    <choice>
      <element ref="t:foo3" maxOccurs="unbounded"/>
      <element ref="t:bar3" minOccurs="0" maxOccurs="unbounded"/>
    </choice>
  </group>

  <element name="foo2" type="string"/>
  <element name="bar2" type="string"/>

  <element name="foo3" type="string"/>
  <element name="bar3" type="string"/>

</schema>
