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.
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.
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:
<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']"
>
<jaxb:bindings node="//xsd:element[@name='Error']">
<jaxb:package name="ABC"/>
</jaxb:bindings>
<jaxb:globalBindings
underscoreBinding="asCharInWord"
localScoping="toplevel"
typesafeEnumMaxMembers="10000"
generateElementClass="true"
>
</jaxb:globalBindings>
<!--
<jaxb:package name="ABC"/>
-->
<!--
<jaxb:schemaBindings>
<jaxb:package name="ABC"/>
</jaxb:schemaBindings>
-->
<!--
<jaxb:schemaBindings>
<jaxb:package name="ABC"/>
<jaxb:nameXmlTransform>
<jaxb:elementName prefix="Error"/>
</jaxb:nameXmlTransform>
</jaxb:schemaBindings>
-->
</jaxb:bindings>
No matter wh