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:
<xs:element name="item" type="itemType"/>
...
<xs:complexType name="itemType">
<xs:attribute name="id" type="xs:string" use="required">
...
</xs:complexType>
and xjc is generating a class called ItemType.java
, but I want the name to be Item.java
. That is, I want the generated classes as if the XSD was like this:
<xs:element name="item">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required">
...
</xs:complexType>
</xs:element>
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.
Any help?
Thanks, Miguel