title: Unable to find datatype after declaring xml schema namespace
body: <p>I am unable to understand certain behavior of declaring XML schema . </p>
  
  <p>Question 
  This xml schema works fine :</p>
  
  <pre><code>*&lt;?xml version="1.0" encoding="windows-1252" ?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns="http://www.example.org" xmlns:ab="http://test.com"
              targetNamespace="http://www.example.org"
              elementFormDefault="qualified"&gt;
    &lt;xsd:element name="simple1" type="complexType1"/&gt;
  
    &lt;xsd:complexType name="complexType1"&gt;
      &lt;xsd:sequence&gt;
        &lt;xsd:element name="element1" type="xsd:string"/&gt;
      &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
  &lt;/xsd:schema&gt;*
  </code></pre>
  
  <p>But if I change targetnamespace  anything apart from <a href="http://www.example.org" rel="nofollow">http://www.example.org</a> , the schema does not find complexType1. Why this happens.
  This does not work. </p>
  
  <pre><code>*&lt;?xml version="1.0" encoding="windows-1252" ?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns="http://www.example.org" xmlns:ab="http://test.com"
              targetNamespace="http://www.example.org99999"
              elementFormDefault="qualified"&gt;
    &lt;xsd:element name="simple1" type="complexType1"/&gt;
  
    &lt;xsd:complexType name="complexType1"&gt;
      &lt;xsd:sequence&gt;
        &lt;xsd:element name="element1" type="xsd:string"/&gt;
      &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
  &lt;/xsd:schema&gt;*
  </code></pre>
  
  <p>Thanks in advance</p>