title: How do you nest complexType elements in an xsd?
body: <p>I have an xml and xsd file that both validate correctly (tested at <a href="http://xsdvalidation.utilities-online.info/" rel="noreferrer">http://xsdvalidation.utilities-online.info/</a>).
  <br /><br />
  However, the xml does not validate against the xsd. I think this is because I am incorrectly nesting complexType elements in the xsd, as compared to the xml. The outer element of <code>people</code> seems to be causing the problem...
  <br /><br />
  Here is the xml:
  <br /></p>
  
  <pre><code>&lt;?xml version = "1.0"?&gt;
  
  &lt;people&gt;
      &lt;person&gt;
          &lt;firstname&gt;Joe&lt;/firstname&gt;
          &lt;lastname&gt;Schmoe&lt;/lastname&gt;
      &lt;/person&gt;
  
      &lt;person&gt;
          &lt;firstname&gt;Cletus&lt;/firstname&gt;
          &lt;lastname&gt;Jenkins&lt;/lastname&gt;
      &lt;/person&gt;
  &lt;/people&gt;
  </code></pre>
  
  <p>...and here is the xsd:
  <br /></p>
  
  <pre><code>&lt;?xml version = "1.0"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
      &lt;xs:element name = "people"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
  
                  &lt;xs:element name = "person"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
  
                              &lt;xs:element name = "firstname" type = "xs:string" /&gt;
                              &lt;xs:element name = "lastname" type = "xs:string" /&gt;
  
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
  
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>