title: Import JAXB binding snippet into other binding file
body: <p>For a certain <code>xsd</code> file, I have created a corresponding binding file that does some actions. In my case, annotating <code>ComplexTypes</code> with annotations. Finding the type is done with an <code>XPath</code> expression. The following example demonstrates this:</p>
  
  <pre><code>&lt;jaxb:bindings 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc" 
      version="2.1" 
      xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="annox"&gt;
  
      &lt;jaxb:bindings schemaLocation="FirstSchema.xsd" node="/xsd:schema"&gt;
  
          &lt;jaxb:bindings node="//xsd:complexType//xsd:element[contains(@type, 'SomeType')]" required="false"&gt;
              &lt;annox:annotate target="field"&gt;@com.example.Type(type = "SomeType")&lt;/annox:annotate&gt;
          &lt;/jaxb:bindings&gt;
  
          //About 100 lines of bindings
      &lt;/jaxb:bindings&gt;
  
  &lt;/jaxb:bindings&gt;
  </code></pre>
  
  <p>There are more bindings defined than just the single I've shown, but my problem is that the bindings are now executed on the <code>FirstSchema.xsd</code>. I have a lot of other <code>xsd</code> files that require the exact same bindings. If I have over 10 more <code>xsd</code> files, I'd have to copy-paste these bindings every time for every schema.</p>
  
  <p>Is it possible to "extract" the bindings and re-use them for every other <code>xsd</code> file like an import? It's kind of related to <a href="https://stackoverflow.com/questions/28041665/jaxb-binding-multiple-files-with-same-namespace-to-same-package#comment44504364_28061518">this comment/question</a>. The advised solution there is using <code>jaxb:schemaBindings/jaxb:package</code>, but if I understand correctly the following snippet just generates the classes into another package and doesn't really solve the problem?</p>
  
  <pre><code>&lt;jaxb:schemaBindings&gt;
      &lt;jaxb:package name="com.example.package"/&gt;
  &lt;/jaxb:schemaBindings&gt;
  </code></pre>