This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes convert beans to XML and retun out of a function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "convert beans to XML and retun out of a function" Watch "convert beans to XML and retun out of a function" New topic
Author

convert beans to XML and retun out of a function

Sven
Greenhorn

Joined: Aug 31, 2004
Posts: 6
Hi
i whould like to convert my java bean into xml and then send it over a network to decode it en build my beans back

i know you can use XMLEncoder e = new XMLEncoder(
new BufferedOutputStream(
new FileOutputStream("Test.xml")))
but i wonderif there is a way to not save it as a file first and return a stream or a string in my function

like this :
public String getPaginaToXML() {
return "converted bean as xml"
}

thanx
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi,
Welcome to Javaranch,
May i request you to change your display name as indicated in http://www.javaranch.com/name.jsp
Thank you.
[ September 28, 2004: Message edited by: Balaji Loganathan ]

Spritle Software Blogs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert beans to XML and retun out of a function
 
Similar Threads
Map object through servlet?
JavaBean to XML and XML to JavaBean
Why these xpath function cannot work properly in such Document?
Outputstream string
Problems to save serialization Objects with Tomcat using XMLDecoder