slide 30

XSD Complex Type

(In DTD syntax: <!ELEMENT name (given, family) > )

<xs:element name="given" type="xs:string"/>
  
<xs:element name="family" type="xs:string"/>

<xs:element name="name">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="given"/>
      <xs:element ref="family"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

Validates
<name><given>John</given><family>Wayne</family></name>
but not
<name><family>Mifune</family><given>Toshiro</given></name>