title: JAXB class generation with imported XSD and binding
body: <p>I am trying to generate classes from following <code>common.xsd</code> which imports <code>x.xsd</code> and <code>y.xsd</code>.</p>
  
  <p><strong><code>common.xsd</code></strong> is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
      &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:import namespace="mynamespace:x" schemaLocation="x.xsd"/&gt;
      &lt;xs:import namespace="mynamespace:y" schemaLocation="y.xsd"/&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>I try to use a binding file that specifies a common interface that is to be implemented by the generated classes. My binding file is as follows:</p>
  
  <pre><code>jaxb:extensionBindingPrefixes="inheritance" version="2.1"&gt;
  
  &lt;jaxb:globalBindings&gt; 
      &lt;jaxb:javaType name="java.lang.Long" xmlType="xsd:integer"/&gt; 
  &lt;/jaxb:globalBindings&gt;
  
  &lt;jaxb:bindings schemaLocation="common.xsd" node="/xsd:schema"&gt;
  
      &lt;jaxb:bindings node="xsd:complexType[@name='Customer']"&gt;
          &lt;inheritance:implements&gt;jaxb.BaseMessage&lt;/inheritance:implements&gt;
          &lt;jaxb:class /&gt;
      &lt;/jaxb:bindings&gt;
  
      &lt;jaxb:bindings node="xsd:complexType[@name='Payments']"&gt;
          &lt;inheritance:implements&gt;jaxb.BaseMessage&lt;/inheritance:implements&gt;
          &lt;jaxb:class /&gt;
      &lt;/jaxb:bindings&gt;
  </code></pre>
  
  <p></p>
  
  <p>I tried to generate the code but it complains that:</p>
  
  <pre><code>[ERROR] XPath evaluation of "xsd:complexType[@name='Customer']" results in empty target node
  [ERROR] XPath evaluation of "xsd:complexType[@name='Payments']" results in empty target node
  </code></pre>
  
  <p>How can I define the nodes in the bindings files are actually in the individual external XSD files but not in <code>common.xsd</code>?</p>