Hi all,
We are working on Marshalling and Unmarshalling XML data using castor.
While running test.xml we are getting the below exception.
MarshalException "The class for the root element 'Dtapp' could not be found"
Below is the code i wrote in XMLTransform.java
public final Object unmarshal(String xml)
{
StringReader stringReader = new StringReader( xml );
if (xml == null)
{
Logger.log("XMLTransformer\t unmarshal\t XML is null");
}
InputSource inputSource = new InputSource( stringReader );
Object o = null;
try
{
unmarshaller.setResolver ((XMLClassDescriptorResolver) xcdr);
unmarshaller.setValidation(true); //jk - set to false if there is a
performance impact.
o = unmarshaller.unmarshal(Dtapp.class, inputSource );
}
catch (ValidationException e)
{
Logger.log("XMLTransformer\t unmarshal\t ValidationException"+e);
}
catch (MarshalException e1)
{
Logger.log("XMLTransformer\t unmarshal\t MarshalException"+e1);
}
catch (Exception e2)
{
Logger.log("XMLTransformer\t unmarshal\t Exception"+e2);
}
return o;
}
Can any one suggest me where the problem was?
Thanks & Regards,
Venkat.
--
View this message in context:
http://www.nabble.com/MarshalException-%22The-class-for-the-root-element-%27xsd%27-could-not-be-found%22-tf3265114.html#a9076206
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email