Hi Mark,
When you generated the source code you should see a bunch of classes with the name *Descriptor.java, make sure these class definitions are compiled. For example your Response.class should also have an associated ResponseDescriptor.class. It's this class-descriptor that tells Castor how to marshal. Make sure it's compiled otherwise Castor won't be able to find it, and will have to revert to introspection and guessing! --Keith Mark Lybarger wrote: > > Hi, > > We're using castor to take a simple java class and marshal to xml. we save that xml > into the database and then unmarshal the data back to an object for presentation. > the class that we're marshalling was generated by castor from an xml schema. the > schema used goes something like this: > > <?xml version="1.0"?> > > <schema xmlns="http://www.w3.org/2001/XMLSchema"> > <element name="Response"> > <complexType> > <sequence> > <element name="recordId" type="string"/> > <element name="dataTrans" type="string"/> > > My understanding is that the sequence is suppose to ensure the elements are all in > the same order starting with recordId, dataTrans, etc. The issue is that when > marshaling the data from an instance of the Response class that was created, the xml > elements aren't in order. I don't see a way to pass a schema into the Marshaler to > have it enforce the schema definition at all. Basically, is it possible for me to > make sure my class follows the schema definition when being marshalled? > > btw, my Response class has a marshal( writer) method, but we're using the static > method of the Marshaler to unmarshal. would using the class method resolve this? > > thanks! > ~mark > > ------------------------------------------------------------------------ > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-user ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
