File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java to xml

 
Njk Naresh
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
can any one give a source code for creation of xml file by using java.
we are using struts
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.ibiblio.org/xml/books/xmljava/chapters/ch03s02.html

has your answer..
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
castor and xStreams are the right framework to be used for your kind of requirement.Have a look them.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you want to create XML from Java Objects or you want to create XML using Java?

If you want to create XML to Java Objects and Vice versa, then as Rahul suggested XSTREAM or Castor.

If you want to create XML using Java then dom4j and off course there other lots of open source libraries avaliable.

simple google search will give you link to those.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the classes you want to turn into XML are JavaBeans, then you can use the java.beans.XMLEncoder and XMLDecoder classes. It doesn't get any easier than that.
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use jsse.jar and sax2.jar in your java classpath.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic