W3C

ComplexTypeSequenceChoice Example

  <xs:element name="mortgage" type="ex:Mortgage"/>

  <xs:complexType name="Mortgage">
        <xs:sequence>
          <xs:element name="amount" type="xs:int"/>
          <xs:choice>
            <xs:element name="repayment" type="ex:Repayment"/>
            <xs:element name="interestonly" type="ex:InterestOnly"/>
          </xs:choice>
        </xs:sequence>
      </xs:complexType>

  <xs:complexType name="Repayment">
        <xs:sequence>
          <xs:element name="years" type="xs:int"/>
          <xs:element name="months" type="xs:int"/>
          <xs:element name="rate" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>

  <xs:complexType name="InterestOnly">
        <xs:sequence>
          <xs:element name="years" type="xs:int"/>
          <xs:element name="rate" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>

The example schema [ComplexTypeSequenceChoice.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
ComplexTypeSequenceChoice01
ComplexTypeSequenceChoice02

  <ex:mortgage>
        <ex:amount>225000</ex:amount>
        <ex:repayment>
          <ex:years>20</ex:years>
          <ex:months>6</ex:months>
          <ex:rate>5.25</ex:rate>
        </ex:repayment>
      </ex:mortgage>
  <ex:mortgage>
        <ex:amount>225000</ex:amount>
        <ex:interestonly>
          <ex:years>25</ex:years>
          <ex:rate>5.50</ex:rate>
        </ex:interestonly>
      </ex:mortgage>

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$