title: Can we generate JAXB classes for a set of xsd in multiple packages?
body: <p>I have an xsd which has <strong>several child XSD</strong> s embedded (using "xsd:include".) in it (but each xsd belongs to the <strong>same namespace</strong>). I was asked to generate jaxb classes in <strong>separate sub packages</strong> (one sub package per each child XSD) instead of one package.</p>
  
  <p>According to what I have read so far, we can add <code>jaxb:schemaBindings</code> to these separate xsds and generate the classes in separate packages, if only those xsds belong to <strong>different namespaces</strong>. </p>
  
  <p>But in my case, what I want to do is to create classes in several sub packages for a set of xsds belong to the <strong>same namespace</strong>. Could you please help me to do this using JAXB?</p>
  
  <p><hr/>
  <strong>Edit:</strong> I have added little more description about my problem to clarify it little bit more.</p>
  
  <p>All of my XSDs has following header. Therefore <strong>same namespace</strong>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema xmlns:srm="http://www.mycompany.com/srm/"
      targetNamespace="http://www.mycompany.com/srm/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0" elementFormDefault="qualified"
      attributeFormDefault="unqualified" version="1.0"&gt;
  </code></pre>
  
  <p>Let's say my schema file names are A.xsd, B.xsd, and C.xsd.</p>
  
  <ul>
  <li><p>In C.xsd, I have defined some elements (string type) with above mentioned header.</p></li>
  <li><p>In B.xsd, I have included C.xsd using "xsd:include" tag, then there is a complexType definition using the complex types defined in C.xsd.(Has the same header I have mentioned above)</p></li>
  <li><p>In A.xsd, I have included B.xsd using "xsd:include" tag, then there is a complexType definition using the complex types defined in B.xsd.(Has the same header I have mentioned above)</p></li>
  </ul>
  
  <p>I want to generate JAXB classes like I have mentioned below.</p>
  
  <ul>
  <li><p>The JAXB classes related to A.xsd to generate in com.generate.packageA package.</p></li>
  <li><p>The JAXB classes related to B.xsd to generate in com.generate.packageB package.</p></li>
  <li><p>The JAXB classes related to C.xsd to generate in com.generate.packageC package.</p></li>
  </ul>