title: XML / XSD 'extension' of an element always has undefined complexType
body: <p>I am attempting to write an XSD Schema that extends a ComplexType that is defined in an Element.</p>
  
  <p>I am attempting to use the Notepad++ XMLTools plugin to troubleshoot the issue, but I always get "Unable to Parse Schema file." with no description of the error, so I have been using the Validator located here to get more details:</p>
  
  <p><a href="http://www.xmlforasp.net/schemavalidator.aspx" rel="nofollow">http://www.xmlforasp.net/schemavalidator.aspx</a></p>
  
  <p>The Output I get from this is:</p>
  
  <p><em>Status:</em>
  <strong>Undefined complexType 'http://test.org:BaseClass' is used as a base for complex type extension.</strong></p>
  
  <p>I've tried removing the :test namespace in the xs:schema tag, I've tried removing the test: namespace qualifier from the ref within ClassHierarchy, and I've tried adding the namespace to the element definitions, but I cannot get the schema to pass validation.</p>
  
  <p>Any help would be greatly appreciated! Thanks</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema
      xmlns:test="http://test.org"
      targetNamespace="http://test.org"
      elementFormDefault="qualified"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
      &lt;xs:element name="BaseClass"&gt;
          &lt;xs:complexType&gt;
              &lt;!-- More referneces in here (Meaning this must be a complex type) but removed out to make a bit simpler --&gt;
              &lt;xs:attribute name="test_name" type="xs:string" use="required"/&gt;
              &lt;xs:attribute name="second_name" type="xs:string"/&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="SubClass"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:complexContent&gt;
                  &lt;xs:extension base="test:BaseClass"&gt;
                      &lt;xs:attribute name="min_value" type="xs:float" default="0.0"/&gt;
                      &lt;xs:attribute name="max_value" type="xs:float" default="1.0"/&gt;
                  &lt;/xs:extension&gt;
              &lt;/xs:complexContent&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
  
      &lt;xs:element name="ClassHierarchy"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
                      &lt;xs:element ref="test:BaseClass" minOccurs="0" maxOccurs="unbounded"/&gt;
                      &lt;xs:element ref="test:SubClass" minOccurs="0" maxOccurs="unbounded"/&gt;
                  &lt;/xs:choice&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>The XML File Contains:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
      &lt;ClassHierarchy
      xmlns="http://test.org"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://test.org Test.xsd"&gt;
          &lt;BaseClass test_name="Test1" /&gt;
          &lt;SubClass test_name="Test2" min_value="0.0" max_value="1.0" /&gt;
      &lt;/ClassHierarchy&gt;
  </code></pre>