title: How to extend a choice complexType without sequencing the choice?
body: <p>I have a choice complexType named <code>abType</code>:</p>
  
  <pre><code>&lt;xs:complexType name="abType"&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:element name="a"/&gt;
          &lt;xs:element name="b"/&gt;
      &lt;/xs:choice&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>This type can be used to create elements with <code>a</code> and <code>b</code> nodes in any order like this for example:</p>
  
  <pre><code>&lt;ab&gt;
      &lt;b/&gt;
      &lt;a/&gt;
  &lt;/ab&gt;
  </code></pre>
  
  <p>Now I want to create a derived type called <code>abcType</code> to allow the nodes <code>a</code>, <code>b</code> and <code>c</code> in any order. Therefore I created a new complexType based on <code>abType</code>:</p>
  
  <pre><code>&lt;xs:complexType name="abcType"&gt;
      &lt;xs:complexContent&gt;
          &lt;xs:extension base="abType"&gt;
              &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xs:element name="c"/&gt;
              &lt;/xs:choice&gt;
          &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>After that I created a <code>abc</code> node:</p>
  
  <pre><code>&lt;abc&gt;
      &lt;c/&gt;
      &lt;b/&gt;
      &lt;a/&gt;
  &lt;/abc&gt;
  </code></pre>
  
  <p>But this node is <strong>invalid</strong>! It is not valid to put any <code>a</code> or <code>b</code> after a <code>c</code>. The reason is, that deriving a type from a base type creates an implicite sequence although both types are choices. XMLspy illustrates it in this way:</p>
  
  <p><img src="https://i.stack.imgur.com/gpoFm.png" alt="Extended Choice Type"></p>
  
  <p>This result is quite useless for choice types.</p>
  
  <p>So my question is: <em>How to extend a choice type without sequencing the choice?</em></p>
  
  <p>Here is the complete XSD and an XML test file to reproduce the problem:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
  &lt;xs:element name="root"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element ref="ab"/&gt;
              &lt;xs:element ref="abc"/&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="ab" type="abType"/&gt;
  &lt;xs:complexType name="abType"&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:element name="a"/&gt;
          &lt;xs:element name="b"/&gt;
      &lt;/xs:choice&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="abc" type="abcType"/&gt;
  &lt;xs:complexType name="abcType"&gt;
      &lt;xs:complexContent&gt;
          &lt;xs:extension base="abType"&gt;
              &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xs:element name="c"/&gt;
              &lt;/xs:choice&gt;
          &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="inherit-choice.xsd"&gt;
  &lt;ab&gt;
      &lt;b/&gt;
      &lt;a/&gt;
  &lt;/ab&gt;
  &lt;abc&gt;
      &lt;c/&gt;
      &lt;b/&gt;
      &lt;a/&gt;
  &lt;/abc&gt;
  &lt;/root&gt;
  </code></pre>