title: XML targetNamespace and unqualified declaration of elements
body: <p>I'm somewhat confused as to how the <code>targetNamespace</code> attribute in an XML schema affects the naming of elements. I'm getting an error validating the following:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="test" version="1.0"&gt;
      &lt;xs:element name="testType" type="testType"/&gt;
      &lt;xs:complexType name="testType"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="testSubtype" type="testSubType" /&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
      &lt;xs:complexType name="testSubType"&gt;
          &lt;!-- some fields --&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>XMLSpy is stating it <code>Cannot resolve the unqualified declaration or definition 'testSubType'.</code> How can I resolve this? I need to keep the <code>targetNamespace</code> attribute in there. I've tried changing <code>testSubType</code> to <code>test:testSubType</code> in various areas but this doesn't seem to work.</p>