Hi,

I have an object Person (defined in XSD).
I hava another object Employee which extends Person (and is also defined in
the XSD).
I can marshall and unmarshall the generated (Castor) classes to XML without
any problem so long as I use the unmarshalling code below

          Unmarshaller unmar = new Unmarshaller(cls);
        unmar.setIgnoreExtraElements(true);    
        unmar.setValidation(false);
        return ( unmar.unmarshal(new CharArrayReader(xml.toCharArray())) ) 

Where cls is either Person.class or Employee.class

However my problem arises where I have the marshalled XML of an Employee. Is
there anyway of determining that this is an employee rather than a Person ?
Currently what I need to do is to unmarshall as a Person, figure out that it
should infact have been an Employee and then unmarshall again as an
Employee. Without doing this I don't get the extra Employee elements.

Any help would be appreciated as this is obviously a source of a bottleneck
at the moment.

Thanks,

Brian


**********************************************************************
The information contained in this e-mail is confidential, may be privileged and is 
intended only for the user of the recipient named above.  If you are not the intended 
recipient or a representative of the intended recipient, you have received this e-mail 
in error and must not copy, use or disclose the contents of this e-mail to anybody 
else.  If you have received this e-mail in error, please notify the sender immediately 
by return e-mail and permanently delete the copy you received.  This e-mail has been 
swept for computer viruses.  However, you should carry out your own virus checks. 
Registered in Ireland, No. 205721.  http://www.FINEOS.com
**********************************************************************

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to