title: JAXB XJC Two declarations cause a collision. Customized binding cannot be honored
body: <p>I would like to generate JAXB classes from this schema file:
  <a href="http://www.taxonx.org/schema/v1/taxonx1.xsd" rel="nofollow">http://www.taxonx.org/schema/v1/taxonx1.xsd</a></p>
  
  <p>I resolved a couple of naming collisions caused by the imported mods-3-1.xsd using customized bindings as follows:</p>
  
  <pre><code>&lt;jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1"&gt;
  
    &lt;jxb:bindings schemaLocation="http://www.loc.gov/standards/mods/v3/mods-3-1.xsd"&gt;
      &lt;jxb:bindings
          node="//xsd:complexType[@name='relatedItemType']/xsd:attribute[@name='type']"&gt;
          &lt;jxb:property name="type2" /&gt;
      &lt;/jxb:bindings&gt;
  
      &lt;jxb:bindings
          node="//xsd:attributeGroup[@name='language']/xsd:attribute[@name='lang']"&gt;
          &lt;jxb:property name="lang2" /&gt;
      &lt;/jxb:bindings&gt;
  
      &lt;jxb:bindings
          node="//xsd:complexType[@name='titleInfoType']/xsd:complexContent/xsd:extension/xsd:attribute[@name='type']"&gt;
          &lt;jxb:property name="type3" /&gt;
      &lt;/jxb:bindings&gt;
  
      &lt;jxb:bindings
          node="//xsd:complexType[@name='nameType']/xsd:attribute[@name='type']"&gt;
          &lt;jxb:property name="type4" /&gt;
      &lt;/jxb:bindings&gt;
  
      &lt;jxb:bindings
          node="//xsd:complexType[@name='unstructuredText']/xsd:simpleContent/xsd:extension/xsd:attribute[@name='type']"&gt;
          &lt;jxb:property name="type5" /&gt;
      &lt;/jxb:bindings&gt;
    &lt;/jxb:bindings&gt;
  &lt;/jxb:bindings&gt;
  </code></pre>
  
  <p>When I want to generate classes I still get the following error:</p>
  
  <pre><code>parsing a schema...
  compiling a schema...
  [ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 468 of http://digir.net/schema/conceptual/darwin/manis/1.21/darwin2.xsd
  
  [ERROR] (Related to above error) This is the other declaration.
  line 326 of http://digir.sourceforge.net/schema/protocol/2003/1.0/digir.xsd
  
  Failed to produce code.
  </code></pre>
  
  <p>When I add another customized binding..</p>
  
  <pre><code>&lt;jxb:bindings schemaLocation="http://digir.net/schema/conceptual/darwin/manis/1.21/darwin2.xsd"&gt;
      &lt;jxb:bindings
          node="//xsd:element[@name='requiredList' and @substitutionGroup='digir:requiredList']"&gt;
          &lt;jxb:property name="requiredList2" /&gt;
      &lt;/jxb:bindings&gt;
  &lt;/jxb:bindings&gt;
  </code></pre>
  
  <p>I get another error:</p>
  
  <pre><code>parsing a schema...
  [ERROR] compiler was unable to honor this property customization. It is attached to a     
  wrong place, or its inconsistent with other bindings.
  line 34 of file:/C:/git/charaparser%20-%20Copy/resources/io/darwinCore/mods-3-1-
  bindings.xml
  
  [ERROR] (the above customization is attached to the following location in the schema)
  line 468 of http://digir.net/schema/conceptual/darwin/manis/1.21/darwin2.xsd
  
  Failed to parse a schema.
  </code></pre>
  
  <p>Any ideas how to solve this?</p>