title: Import namespace - Cannot resolve the name to a(n) 'type definition' component
body: <p>Context: I am generating xsd files using Eclipse. All my .xsd files are in a single location - Project/ directory.</p>
  
  <p>Problem: Everything works fine when xsd's don't reference/import other xsd's with a different target namespace. However when the following xsd below (with <code>namespace="http://www.example.org/experimento"</code>) imports another xsd <code>lugar_experimento.xsd</code> from a different namespace (<code>namespace="http://www.example.org/lugar_experimento"</code>), I get the following error:</p>
  
  <pre><code>Cannot resolve the name xxx to a(n) 'type definition' component.
  </code></pre>
  
  <p>Here is my XSD (<code>experimento.xsd</code>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="http://www.example.org/experimento"
  xmlns:tns="http://www.example.org/experimento"
  xmlns:lugar="http://www.example.org/lugar_experimento" 
  elementFormDefault="qualified"&gt;
  
      &lt;xsd:import schemaLocation="lugar_experimento.xsd" namespace="http://www.example.org/lugar_experimento"/&gt;
      &lt;xsd:complexType name="experimento"&gt;
              &lt;xsd:sequence&gt;
                      &lt;xsd:element name="identificador" type="xsd:string" /&gt;
                      &lt;xsd:element name="lugar" type="lugar:tipoRefGeografica"/&gt;
              &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;      
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>And I want to use the following XSD:' to 'And I want to use the following XSD (saved in <code>lugar_experimento.xsd</code>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="http://www.example.org/lugar" 
  xmlns:tns="http://www.example.org/lugar" 
  elementFormDefault="qualified"&gt;
  
  &lt;xsd:complexType name="tipoRefGeografica"&gt;
      &lt;xsd:choice&gt;
          &lt;xsd:element name="W3Cgeo" type="tns:tipoW3Cgeo" /&gt;
          &lt;xsd:element name="kml" type="tns:tipoKml" /&gt;
      &lt;/xsd:choice&gt;
  &lt;/xsd:complexType&gt;
  
  &lt;xsd:simpleType name="tipoKml"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
          &lt;xsd:pattern value="\d\.{0,1}\d*\s\d+\.{0,1}\d*"/&gt;
      &lt;/xsd:restriction&gt;
  &lt;/xsd:simpleType&gt;
  
  &lt;xsd:complexType name="tipoW3Cgeo"&gt;
      &lt;xsd:sequence&gt;
          &lt;xsd:element name="lat" type="xsd:decimal" /&gt;
          &lt;xsd:element name="long" type="xsd:decimal" /&gt;      
      &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>What I am doing wrong? Do you have any easy example?</p>