This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Can I serialize into an XML format? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Can I serialize into an XML format?" Watch "Can I serialize into an XML format?" New topic
Author

Can I serialize into an XML format?

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 679

I did the following as an exercise to learn how to do serialization. It works, but I believe that it reads and writes an object in a binary format. My question is how can I serialize my Cat object into XML format?


[ September 10, 2008: Message edited by: Kaydell Leavitt ]
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

You can use java.beans.XMLEncoder for that, e.g.

Alternatively, you can use XStream.
http://xstream.codehaus.org/


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Jibitesh Prasad
Greenhorn

Joined: Feb 20, 2007
Posts: 20
Or you can try Apache's Xerces.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I serialize into an XML format?
 
Similar Threads
Update Serializable Object
Deserialize object from file failing
print statements not working in serialization code
doubt with serialization
Java class consisting of serialVersionUID