title: Element http://www.w3.org/2001/XMLSchema:complexType is invalid in this context
body: <p>I'm trying to validate this XML file</p>
  
  <pre><code>&lt;session&gt;
      &lt;mic id="1" posname="T1" x="0.0" y="0.0" z="0.0" /&gt;
  &lt;/session&gt;
  </code></pre>
  
  <p>using this XSD file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema 
      xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      attributeFormDefault="unqualified" 
      elementFormDefault="qualified"&gt;
  
      &lt;xs:element name="session"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="mic" type="micType" minOccurs="1" maxOccurs="4"&gt;
                  &lt;/xs:element&gt;
  
                  &lt;xs:complexType name="micType"&gt;
                      &lt;xs:simpleContent&gt;
                          &lt;xs:extension base="xs:string"&gt;
                              &lt;xs:attribute type="xs:int" name="id"/&gt;
                              &lt;xs:attribute type="xs:string" name="posname"/&gt;
                              &lt;xs:attribute type="xs:float" name="x"/&gt;
                              &lt;xs:attribute type="xs:float" name="y"/&gt;
                              &lt;xs:attribute type="xs:float" name="z"/&gt;
                          &lt;/xs:extension&gt;
                      &lt;/xs:simpleContent&gt;
                  &lt;/xs:complexType&gt; 
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>but I get this error message: </p>
  
  <blockquote>
    <p>XmlSchema error: Element <a href="http://www.w3.org/2001/XMLSchema:complexType" rel="nofollow noreferrer">http://www.w3.org/2001/XMLSchema:complexType</a> is invalid in this context.</p>
  </blockquote>
  
  <p>If I just have the attribute definition for the mic element the program runs fine. I don't know what I'm doing wrong. I'm trying to have the XSD validate the data types for the mic element. Can anybody please tell me what I'm doing wrong?</p>