title: XSD schema for this fragment
body: <p>i'm writing a schema, and i can't think of how to represent this xml fragment:</p>
  
  <pre><code>&lt;ActionTaken&gt;
     &lt;Description partID="H1" sequenceNumber="01"&gt;i did this&lt;/Description&gt;
     &lt;Description partID="H1" sequenceNumber="02"&gt;and then some more stuff.&lt;/Description&gt;
  &lt;/ActionTaken&gt;
  </code></pre>
  
  <p>What i had initially created was:</p>
  
  <pre><code>&lt;xs:element name="ActionTaken"&gt;
     &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
           &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99" /&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
        &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
  </code></pre>
  
  <p>But that's wrong because the attributes are applied to the <code>ActionTaken</code> element, rather than the <code>Description</code> elements.</p>
  
  <blockquote>
    <p><strong>Note</strong>: Is there <strong><em>ANY</em></strong> way to declare attributes before the elements? Attributes do, after all, come <strong>before</strong> elements!</p>
  </blockquote>
  
  <p>So i'm trying to figure out how to push the attributes down onto the <code>Description</code> element:</p>
  
  <pre><code>&lt;xs:element name="ActionTaken"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99" /&gt;
              &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
              &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>That doesn't work because you cannot have an <code>attribute</code> in the <code>sequence</code>. i tried:</p>
  
  <pre><code>&lt;xs:element name="ActionTaken"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99" &gt;
                  &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
                  &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>But that doesn't work because of who the hell knows.</p>
  
  <p>i could keep randomly trying s<strike>h</strike>tuff; or i could get the real answer.</p>
  
  <hr>
  
  <h2>Attempt 4</h2>
  
  <pre><code>&lt;xs:element name="ActionTaken"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99" &gt;
                  &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
                  &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <h2>Attempt 5</h2>
  
  <pre><code>&lt;xs:element name="DescriptionOfSuspiciousActivity"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99"&gt;
                  &lt;xs:complexType&gt;
                      &lt;!--Description of Suspicious Activity (Part G) attributes--&gt;
                      &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
                      &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <h2>Attempt 6</h2>
  
  <pre><code>&lt;xs:element name="ActionTaken"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="Description" type="String400" minOccurs="1" maxOccurs="99" &gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:attribute name="partID" type="STReportTypeEnum" /&gt;
                      &lt;xs:attribute name="partSequenceNumber" type="NumericTwoRJZ" /&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>Camel: a horse designed by committee<br>
  XSD: designed by committee</p>