Add-on | Schema example


Ditto in XML Schema notation: (Trust me, it is the same, I tested it :-) )

<x:schema xmlns:x="http://www.w3.org/2000/10/XMLSchema">

  <x:element name="populationdata" type="populationdata" />

<!-- The types of all elements -->

  <x:complexType name="pop" mixed="true">
  </x:complexType>

  <x:complexType name="country">
    <x:group ref="country" />
  </x:complexType>

  <x:complexType name="province">
    <x:group ref="province" />
  </x:complexType>

  <x:complexType name="city">
    <x:group ref="city" />
  </x:complexType>

  <x:complexType name="populationdata">
    <x:group ref="populationdata" />
  </x:complexType>

  <x:complexType name="name" mixed="true">
  </x:complexType>

  <x:complexType name="continent">
    <x:group ref="continent" />
  </x:complexType>

<!-- The content models of all elements -->

  <x:group name="pop">
    <x:sequence>
    <!-- x:decimal -->
    </x:sequence>
  </x:group>

  <x:group name="country">
    <x:sequence>
    <x:element name="name" type="name" />
    <x:element name="province" type="province" minOccurs="0" maxOccurs="unbounded" />
    </x:sequence>
  </x:group>

  <x:group name="province">
    <x:sequence>
    <x:element name="name" type="name" />
    <x:element name="city" type="city" minOccurs="0" maxOccurs="unbounded" />
    </x:sequence>
  </x:group>

  <x:group name="city">
    <x:sequence>
    <x:element name="name" type="name" />
    <x:element name="pop" type="pop" />
    </x:sequence>
  </x:group>

  <x:group name="populationdata">
    <x:sequence>
    <x:element name="continent" type="continent" minOccurs="0" maxOccurs="unbounded" />
    </x:sequence>
  </x:group>

  <x:group name="name">
    <x:sequence>
    <!-- x:string -->
    </x:sequence>
  </x:group>

  <x:group name="continent">
    <x:sequence>
    <x:element name="name" type="name" />
    <x:element name="country" type="country" minOccurs="0" maxOccurs="unbounded" />
    </x:sequence>
  </x:group>

</x:schema>