title: JAXB: How to change XJC-generated classes names when attr type is specified in XSD?
body: <p>I'm a beginner to JAXB and I'm having annoying issues when generating Java classes with xjc. I am provided with a XSD like this: </p>
  
  <pre><code>&lt;xs:element name="item" type="itemType"/&gt;  
  ...   
  &lt;xs:complexType name="itemType"&gt;
      &lt;xs:attribute name="id" type="xs:string" use="required"&gt;
      ...     
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>and xjc is generating a class called <code>ItemType.java</code>, but I want the name to be <code>Item.java</code>. That is, I want the generated classes as if the XSD was like this:</p>
  
  <pre><code>&lt;xs:element name="item"&gt;
      &lt;xs:complexType&gt;
      &lt;xs:attribute name="id" type="xs:string" use="required"&gt;
          ...
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>There won't be any reuse of itemType on any other element, it's just the people that constructs the XSD likes it this way.
  I guess there may be a way to do it with custom bindings but I still haven't found how.</p>
  
  <p>Any help?</p>
  
  <p>Thanks,
  Miguel</p>