W3C

TypeSubstitutionUsingXsiType Example

  <xs:element name="assembly" type="ex:Assembly"/>

  <xs:complexType name="Assembly">
        <xs:sequence>
          <xs:element name="part" minOccurs="0" maxOccurs="unbounded" type="ex:Part"/>
        </xs:sequence>
      </xs:complexType>

  <xs:element name="part" type="ex:Part"/>

  <xs:complexType name="Part">
        <xs:sequence>
          <xs:element name="number" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>

  <xs:complexType name="Part2">
        <xs:complexContent>
          <xs:extension base="ex:Part">
            <xs:sequence>
              <xs:element name="description" type="xs:string"/>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>

The example schema [TypeSubstitutionUsingXsiType.xsd] has been classified as being "" as it exhibits the following patterns:

Status Name XPath

To facilitate testing, the example schema element has been wrapped in the following descriptions:

The following valid instance documents are provided:

Instance Validity
TypeSubstitutionUsingXsiType01

  <ex:assembly>
        <ex:part>
          <ex:number>p1</ex:number>
        </ex:part>
        <ex:part xsi:type="ex:Part2">
          <ex:number>p2</ex:number>
          <ex:description>extended part</ex:description>
        </ex:part>
      </ex:assembly>

This document was produced by the W3C XML Schema Patterns for Databinding Working Group. Comments on this document may be sent to the public public-xsd-databinding-comments@w3.org mailing list (public archive).

Generated from examples.xml $Date$