title: Compile several XSD's containing duplicate definitions of the same element with JAXB
body: <p><strong>Question:</strong> 
  How do i make xjc/Jaxb generate the propper javaclasses for several schemas containing duplicate elementdefinitions in the same namespace?</p>
  
  <p><strong>Information:</strong>
  I have three .xsd schemas: A,B and C. All have the same targetnamespace.
  They are all 3 shemas that has been given to me, and i am not, in any way possible, allowed to change them in any way.</p>
  
  <p>They A has some elements that is also found in B or C (but A has a lot of self declared elements as well)
  Example: This is the same "code" for A and C:</p>
  
  <pre><code>&lt;xs:simpleType name="y_ym_ymdDatoType"&gt;
      &lt;xs:union memberTypes="arcgYearType arcgYearMonthType arcDateType"/&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="arcgYearType"&gt;
      &lt;xs:restriction base="xs:gYear"&gt;
          &lt;xs:minInclusive value="1700"/&gt;
          &lt;xs:maxInclusive value="2100"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="arcgYearMonthType"&gt;
      &lt;xs:restriction base="xs:gYearMonth"&gt;
          &lt;xs:minInclusive value="1700-01"/&gt;
          &lt;xs:maxInclusive value="2100-12"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="arcDateType"&gt;
      &lt;xs:restriction base="xs:date"&gt;
          &lt;xs:minInclusive value="1700-01-01"/&gt;
          &lt;xs:maxInclusive value="2100-12-31"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>When using xjc to compile them into javaclasses, i get the following exception:</p>
  
  <pre><code>[ERROR] 'y_ym_ymdDatoType' is already defined
   line 297 of file:../c.xsd
  
  [ERROR] (related to above error) the first definition appears here
   line 309 of file:../a.xsd
  </code></pre>
  
  <p>and the same happens to the other elements: arcgYearType, arcgYearMonthType and arcDateType.</p>
  
  <p>I have read about a binding file that maybe could solve this problem, but i am not sure on how to do it so examples will be highly preferred.</p>