thanks for the timely response, unfortunately this does not work because MyEnum is not of type java.lang.String, the castor mapping file will not even compile because it inspects the fields for their type and excepts due to the type mismatch
On Mon, Aug 9, 2010 at 3:00 PM, KURT PETERS <[email protected]> wrote: > try java.lang.String? > > ------------------------------ > Date: Mon, 9 Aug 2010 14:55:28 -0400 > From: [email protected] > > To: [email protected] > Subject: [castor-user] Simple Enum Use Case - Can't find documentation on > topic > > > public class MyObject { > private MyEnum myEnum; > ... > } > > <class name="MyObject"> > <field name="myEnum" type="MyEnum"/> > </class> > > so once I have this, the problem is that Castor doesn't give the XML type > an "xs:string" which is how the XSD specifies it. I've tried all sorts of > other ways, including adding: > > <bind-xml type="string"/> > > but nothing has worked, the only thing I've gotten to work is to add to > MyObject: > > ... > public String getMyEnumAsString() { > return myEnum.toString(); > } > ... > > I'd imagine this is extremely simple, but so far digging through the docs > I've not found any examples of this. > > Thanks in advance! >

