Hi,

 

My apologies if this is an open issue (I tried searching for this issue,
but no luck).

 

I've got an xsd with a simpleType string like this:

<xs:simpleType name="Inquiry_Status">

      <xs:restriction base="xm:RequiredString">

            <xs:enumeration value="SUCCESS"/>

            <xs:enumeration value="Success"/>

            <xs:enumeration value="FAILED"/>

      </xs:restriction>

</xs:simpleType>

 

Notice the 2 spellings of "SUCCESS" and "Success"

 

When running the castor-maven plugin (dependent on castor-1.0.4) against
this XSD, the generated code appears to get confused about the case
sensitivity:

 

Notice that the 2nd spelling of "Success" gets picked up as the type but
the 1st version gets added as a Hash key. . . 

 

public class Inquiry_Status implements java.io.Serializable {

    public static final int SUCCESS_TYPE = 1;

 

    public static final Inquiry_Status SUCCESS = new
Inquiry_Status(SUCCESS_TYPE, "Success");

 

    public static final int FAILED_TYPE = 2;

 

    public static final Inquiry_Status FAILED = new
Inquiry_Status(FAILED_TYPE, "FAILED");

 

    //  . . . snip . . .

 

    private static java.util.Hashtable init()

    {

        Hashtable members = new Hashtable();

        members.put("SUCCESS", SUCCESS);

        members.put("FAILED", FAILED);

        return members;

    } //-- java.util.Hashtable init() 

            

 

The "simple" answer to just change the XSD isn't, unfortunately,
possible in this situation.  Does anyone know of a work-around or
version fix for this problem?

 

Tom Vaughan | Technical Architect | direct 212 798 7367  | mobile 703
623 7101 | fax 212 966 6915   

 

<<image001.gif>>

Reply via email to