I am not 100% sure, but I think that Castor includes some special logci in its source generation class(es) to deal with special characters (such as _ and /).
Can you please create a new Jira issue at http://jira.codehaus.org/browse/CASTOR and attach the XML schema and parts of this thread. Werner > -----Ursprüngliche Nachricht----- > Von: Barbara Allori [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 16. April 2007 10:52 > An: [email protected] > Betreff: [castor-user] Castor rejects some value > > Hello! > I'm trying to generate java classes for this schema: > > <xs:element name="formato_data"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration > value="DD/MM/YYYY"/> > <xs:enumeration value="DD-MM- > YYYY"/> > <xs:enumeration value="DDMMYYYY"/> > <xs:enumeration > value="DD_MM_YYYY"/> > <xs:enumeration value="YYYYMMDD"/> > <xs:enumeration > value="YYYY_MM_DD"/> > </xs:restriction> > </xs:simpleType> > </xs:element> > > I run the source generator I obtain a Formato_dataType that doesn't > contain DD/MM/YYYY and DD-MM-YYYY value. > I use castor 1.0.5 > What can I do? > > Thank's in advance > Barbara > > > This is the class: > > public class Formato_dataType implements java.io.Serializable { > > > //--------------------------/ > //- Class/Member Variables -/ > //--------------------------/ > > /** > * The DDMMYYYY type > */ > public static final int DDMMYYYY_TYPE = 2; > > /** > * The instance of the DDMMYYYY type > */ > public static final Formato_dataType DDMMYYYY = new > Formato_dataType(DDMMYYYY_TYPE, "DDMMYYYY"); > > /** > * The DD_MM_YYYY type > */ > public static final int DD_MM_YYYY_TYPE = 3; > > /** > * The instance of the DD_MM_YYYY type > */ > public static final Formato_dataType DD_MM_YYYY = new > Formato_dataType(DD_MM_YYYY_TYPE, "DD_MM_YYYY"); > > /** > * The YYYYMMDD type > */ > public static final int YYYYMMDD_TYPE = 4; > > /** > * The instance of the YYYYMMDD type > */ > public static final Formato_dataType YYYYMMDD = new > Formato_dataType(YYYYMMDD_TYPE, "YYYYMMDD"); > > /** > * The YYYY_MM_DD type > */ > public static final int YYYY_MM_DD_TYPE = 5; > > /** > * The instance of the YYYY_MM_DD type > */ > public static final Formato_dataType YYYY_MM_DD = new > Formato_dataType(YYYY_MM_DD_TYPE, "YYYY_MM_DD"); > > /** > * Field _memberTable > */ > private static java.util.Hashtable _memberTable = init(); > > /** > * Field type > */ > private int type = -1; > > /** > * Field stringValue > */ > private java.lang.String stringValue = null; > > > //----------------/ > //- Constructors -/ > //----------------/ > > private Formato_dataType(int type, java.lang.String value) > { > super(); > this.type = type; > this.stringValue = value; > } //-- com.dm.importatore.parser.types.Formato_dataType(int, > java.lang.String) > > > //-----------/ > //- Methods -/ > //-----------/ > > /** > * Method enumerate > * > * Returns an enumeration of all possible instances of > * Formato_dataType > * > * @return an Enumeration over all possible instances of > * Formato_dataType > */ > public static java.util.Enumeration enumerate() > { > return _memberTable.elements(); > } //-- java.util.Enumeration enumerate() > > /** > * Method getType > * > * Returns the type of this Formato_dataType > * > * @return the type of this Formato_dataType > */ > public int getType() > { > return this.type; > } //-- int getType() > > /** > * Method init > * > * > * > * @return the initialized Hashtable for the member table > */ > private static java.util.Hashtable init() > { > Hashtable members = new Hashtable(); > members.put("DD/MM/YYYY", DD_MM_YYYY); > members.put("DDMMYYYY", DDMMYYYY); > members.put("YYYYMMDD", YYYYMMDD); > members.put("YYYY_MM_DD", YYYY_MM_DD); > return members; > } //-- java.util.Hashtable init() > > /** > * Method readResolve > * > * will be called during deserialization to replace the > * deserialized object with the correct constant instance. > * > * @return this deserialized object > */ > private java.lang.Object readResolve() > { > return valueOf(this.stringValue); > } //-- java.lang.Object readResolve() > > /** > * Method toString > * > * Returns the String representation of this Formato_dataType > * > * @return the String representation of this Formato_dataType > */ > public java.lang.String toString() > { > return this.stringValue; > } //-- java.lang.String toString() > > /** > * Method valueOf > * > * Returns a new Formato_dataType based on the given String > * value. > * > * @param string > * @return the Formato_dataType value of parameter 'string' > */ > public static com.dm.importatore.parser.types.Formato_dataType > valueOf(java.lang.String string) > { > java.lang.Object obj = null; > if (string != null) obj = _memberTable.get(string); > if (obj == null) { > String err = "'" + string + "' is not a valid > Formato_dataType"; > throw new IllegalArgumentException(err); > } > return (Formato_dataType) obj; > } //-- com.dm.importatore.parser.types.Formato_dataType > valueOf(java.lang.String) > > } > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

