slide 32

XSD Type Derivation by Extension

<xs:complexType name="name.type">
  <xs:sequence>
    <xs:element ref="given"/>
    <xs:element ref="family" minOccurs="0"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="long-name.type">
  <xs:complexContent>
    <xs:extension base="name.type">
      <!-- this sequence is appended to that of the base type -->
      <xs:sequence>
        <xs:element ref="title" minOccurs="0"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

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

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

<xs:element name="title" type="xs:string"/>

<xs:element name="name" type="long-name.type"/>