I'm using JAXB and intellij webservices plugin to create java files from XSDs. I have two XSDs that defining the same object but when I create them using the "generate java code from XML schema" the object is created twice with his own package. I already tried with import xsd and using the ref attribute and I get the same result.
Here is an example:
This is the first XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.msp-gs.com/workflow"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wc="http://www.example.com/workflow"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
jaxb:version="1.0">
<xs:annotation>
<xs:appinfo>
<jaxb:globalBindings enableJavaNamingConventions="true">
</jaxb:globalBindings>
</xs:appinfo>
</xs:annotation>
<xs:element name="WC">
<xs:complexType>
<xs:sequence>
<xs:element name="Example"
type="wc:Restriction"
minOccurs="1"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Restriction">
<xs:attribute type="xs:string"
name="authorizationTreeId"/>
</xs:complexType>
</xs:schema>
This is the second XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.msp-gs.com/workflow"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:fd="http://www.example.com/workflow"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
jaxb:version="1.0">
<xs:annotation>
<xs:appinfo>
<jaxb:globalBindings enableJavaNamingConventions="true">
</jaxb:globalBindings>
</xs:appinfo>
</xs:annotation>
<xs:element name="FD">
<xs:complexType>
<xs:sequence>
<xs:element name="Example"
type="fd:Restriction"
minOccurs="1"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Restriction">
<xs:attribute type="xs:string"
name="authorizationTreeId"/>
</xs:complexType>
</xs:schema>
I want that Restriction will be the same object.
Thank you.