File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes writing java objects to xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "writing java objects to xml" Watch "writing java objects to xml" New topic
Author

writing java objects to xml

Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi -
I am trying to write the java objects to an xml file, with the objects' member field as the xml tags.
Can some one let me know ways to achieve this?
Thanks in advance,
Radha
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Look for examples on things like Castor...which can map
java objects to XML strings.
I don't have any links off the top of my head.
Hopefully others maybe able to provide better examples/links...
regds.
- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You could also check out the source code for XStream, which is probably the simplest Java-to-XML serializer library I'm aware of.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Vijayanandraj Amaladoss
Greenhorn

Joined: Apr 12, 2004
Posts: 7
Use castor , Simple , Easy and Stable. U can get lots of example and references . Moreover it provides a source code generator which generates java classes for the schema you give.
http://www.castor.org/
Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi -
Thank you all guys for your replies. I have looked into castor and xstreme and am trying to work in those lines.
Radha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing java objects to xml