I face a weird problem. I'm supposed to use a number of third party XSDs for a webservice. My framework of choice is Apache CXF, and I generate code using its Maven plugin. So far so good, everything works, neither generation nor webservice itself is problematic.
But, since the authors of the XSDs are weird and I cannot change them myself, I face a problem: They use a lot of basically duplicated SimpleType-definitions. They all bear their own name, but do the same thing.
Example:
<xs:simpleType name="VehicleFittedWithEcoInnovInd">
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
<xs:enumeration value="Y"/>
<xs:enumeration value="N"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TypeApprTranspDangerGoodsInd">
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
<xs:enumeration value="Y"/>
<xs:enumeration value="N"/>
</xs:restriction>
</xs:simpleType>
And many more (Numbers, Stringdefinitions etc etc).
So the question is, is it possible, through a jaxb-plugin or similar, to aggregate these SimpleTypes into one, or at least generate an abstract class structure, so that the amount of irrelevant duplicate code is reduced?