title: jaxb override package of a specific generated set of classes
body: <p>I have a large third party xsd file that pulls in a whole bunch of other xsd files through imports. The whole thing generates over 1000 classes. When I tell the xjc (jaxb) processor to generate everything in a specific package I get all kinds of naming conflicts. If I don't specify a package, then the processor creates java packages using the target attributes in the xsd files, and the whole thing generates without any errors.</p>
  
  <p>The problem is that the package structure is awful because the target names are chosen really poorly. Other developers hate it. They only need a few classes.</p>
  
  <p>So what I've been trying to do is to give the processor a bindings.xml file where I want to specify certain classes to be generated in a given package name.
  I've gone back and forth between documentation on Oracle's site, forums, samples. I can't quote every single iteration of my bindings file. My current incarnation is this:</p>
  
  <pre><code>&lt;jaxb:bindings 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      version="2.1"
      schemaLocation="heavy.xsd"
      node="//xsd:element[@name='Error']"
  &gt;
  
      &lt;jaxb:bindings node="//xsd:element[@name='Error']"&gt;
          &lt;jaxb:package name="ABC"/&gt;
      &lt;/jaxb:bindings&gt;
  
      &lt;jaxb:globalBindings
          underscoreBinding="asCharInWord"
          localScoping="toplevel"
          typesafeEnumMaxMembers="10000"
          generateElementClass="true"
      &gt;
      &lt;/jaxb:globalBindings&gt;
  
  
  &lt;!--
          &lt;jaxb:package name="ABC"/&gt;
  --&gt;
  
  &lt;!--
      &lt;jaxb:schemaBindings&gt;
          &lt;jaxb:package name="ABC"/&gt;
      &lt;/jaxb:schemaBindings&gt;
  --&gt;
  
  &lt;!--
      &lt;jaxb:schemaBindings&gt;
          &lt;jaxb:package name="ABC"/&gt;
          &lt;jaxb:nameXmlTransform&gt;
              &lt;jaxb:elementName prefix="Error"/&gt;
          &lt;/jaxb:nameXmlTransform&gt;
      &lt;/jaxb:schemaBindings&gt;
  --&gt;
  
  &lt;/jaxb:bindings&gt;
  </code></pre>
  
  <p>No matter what I try, I have not yet seen it generate any classes in the ABC package. In this case I want Error to get generated in ABC. Any help would be greatly appreciated.</p>