title: XSD: Cannot resolve the name 'type' to a(n) 'type definition' component
body: <p>I am defining the schema but on validating it in eclipse it gives following error.</p>
  
  <blockquote>
    <p>src-resolve: Cannot resolve the name 'common:Name' to a(n) 'type definition' component.</p>
  </blockquote>
  
  <p>My schema looks like following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema targetNamespace="http://www.mycompany.com/myproject/service/v1"              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://www.mycompany.com/myproject/service/v1"            
          xmlns:product="http://www.mycompany.com/otherproject/service/products/v1"
          xmlns:common="http://www.mycompany.com/myproject/service/common/v1" elementFormDefault="qualified"&gt;
  
  &lt;xsd:import namespace="http://www.mycompany.com/otherproject/service/products/v1" schemaLocation="products_v1.xsd" /&gt;
  &lt;xsd:import namespace="http://www.mycompany.com/myproject/service/common/v1" schemaLocation="common_v1.xsd" /&gt;          
  
  &lt;xsd:element name="GetProductRequest" type="tns:GetProductRequest"&gt;
      &lt;xsd:annotation&gt;
          &lt;xsd:documentation&gt;Get Product Request&lt;/xsd:documentation&gt;
      &lt;/xsd:annotation&gt;
  &lt;/xsd:element&gt;  
  
  &lt;xsd:complexType name="GetProuctRequest"&gt;
      &lt;xsd:annotation&gt;
          &lt;xsd:documentation&gt;Get Product Request&lt;/xsd:documentation&gt;
      &lt;/xsd:annotation&gt;
      &lt;xsd:sequence&gt;
  
          &lt;xsd:element name="ID" type="common:ID" minOccurs="1" maxOccurs="1"&gt;
              &lt;xsd:annotation&gt;
                  &lt;xsd:documentation&gt;ID&lt;/xsd:documentation&gt;
              &lt;/xsd:annotation&gt;
          &lt;/xsd:element&gt;
  
  
          &lt;xsd:element name="Name" type="common:Name" minOccurs="1" maxOccurs="1"&gt;
              &lt;xsd:annotation&gt;
                  &lt;xsd:documentation&gt;Name&lt;/xsd:documentation&gt;
              &lt;/xsd:annotation&gt;
          &lt;/xsd:element&gt;  
  
      &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  
  .....
  </code></pre>
  
  <p>and common_v1.xsd looks like following</p>
  
  <pre><code>&lt;xsd:schema targetNamespace="http://www.mycompany.com/myproject/service/common/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://www.mycompany.com/myproject/service/common/v1" 
          elementFormDefault="qualified"&gt;
  
  
  &lt;xsd:complexType name="ID"&gt;
      &lt;xsd:annotation&gt;
          &lt;xsd:documentation&gt;ID&lt;/xsd:documentation&gt;
      &lt;/xsd:annotation&gt;
      &lt;xsd:sequence&gt;
          &lt;xsd:element name="X" type="xsd:string" minOccurs="1" maxOccurs="1"&gt;
              &lt;xsd:annotation&gt;
                  &lt;xsd:documentation&gt;X&lt;/xsd:documentation&gt;
              &lt;/xsd:annotation&gt;
          &lt;/xsd:element&gt;
          &lt;xsd:element name="Y" type="xsd:string" minOccurs="1" maxOccurs="1"&gt;
              &lt;xsd:annotation&gt;
                  &lt;xsd:documentation&gt;Y&lt;/xsd:documentation&gt;
              &lt;/xsd:annotation&gt;
          &lt;/xsd:element&gt;
      &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;  
  
  &lt;xsd:element name="Name" type="xsd:string"&gt;
      &lt;xsd:annotation&gt;
          &lt;xsd:documentation&gt;Name&lt;/xsd:documentation&gt;
      &lt;/xsd:annotation&gt;
  &lt;/xsd:element&gt;
  ......
  </code></pre>
  
  <p>Problem is my schema is able to resolve some of the elements from common_v1.xsd and some not. In above code common:ID does not give any error but common:Name gives error.</p>
  
  <p>I am not able to understand why some of the elements are not resolved.</p>