File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes java 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 "java to xml" Watch "java to xml" New topic

java to xml

Njk Naresh

Joined: Nov 16, 2006
Posts: 11
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

Joined: Dec 08, 2006
Posts: 106

has your answer..

<a href="" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="" target="_blank" rel="nofollow">Java Weblog</a> | <a href="" target="_blank" rel="nofollow">Computing Articles</a>
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
castor and xStreams are the right framework to be used for your kind of requirement.Have a look them.

Rahul Bhattacharjee
LinkedIn - Blog
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

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.

Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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

Joined: Dec 08, 2006
Posts: 106
use jsse.jar and sax2.jar in your java classpath.
I agree. Here's the link:
subject: java to xml
It's not a secret anymore!