Baba-5 wrote:
>
> Hi Joshua,
>
> i use the same way to marshaling the java classes to string but in my
> case it's work.
>
> You are light on information about how you unmarshal your XML into
> java classes. My experiences with Castor told me in the most cases if
> the marshaling result is wrong it has its root in the way you
> unmarshal your XML. I use mapping files which define the attributes or
> elements and it works great.
>
>
Hello,
I solved it finally : I declared the StringWriter when I construct the
Marshaller object:
StringWriter strWriter = new StringWriter();
Marshaller marshaller = new Marshaller(strWriter);
and not as parameter when I do marshaller.marshal(object,writer);
now it works correctly!
regards
joshua
--
View this message in context:
http://www.nabble.com/How-to-Marshal-XML-to-a-String---tp20090707p20091712.html
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email