title: how to import XSD types into root schema?
body: <p>This is my existing XSD schema in <code>foo.xsd</code>, that declares just the type:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
    targetNamespace="foo"&gt;
    &lt;xs:complexType name="alpha"&gt;
      &lt;!-- skipped --&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>This is another schema, that declares the element:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
    targetNamespace="foo"&gt;
    &lt;xs:import schemaLocation="foo.xsd" namespace="foo" /&gt;
    &lt;xs:element name="RootElement" type="alpha"/&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>This is what I'm getting from SAX parser in Java:</p>
  
  <pre><code>"The namespace attribute 'foo' of an &lt;import&gt; element information 
  item must not be the same as the targetNamespace of the schema it exists in."
  </code></pre>
  
  <p>What am I doing wrong?</p>