This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes XML file generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "XML file generation" Watch "XML file generation" New topic
Author

XML file generation

Romi Dave
Greenhorn

Joined: Jul 19, 2006
Posts: 26
Hi all,

Can someone please help me with Apache Velocity package? For our webapplication we are required to generate to generate XML file for certain data. My senior developer suggested we use Apache's Velocity package to do so. Now i was trying to post few faqs on apache site but most links are broken so can some one please help me here.

First of all where do I place my template file in the webapp?

Any help or direction to working with Velocity would be greatful, also if you think there is better and easier way to generate xml files in java please do suggest.
Thanks in advance.
[ February 16, 2007: Message edited by: Romi Dave ]
Abdulla Mamuwala
Ranch Hand

Joined: Jan 09, 2004
Posts: 225
how about the JAX-B API. You have the schema with you now you can generate the XML document.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

By any chance are you using Hibernate. If so you can map you classes also to XML and when you create a session you can set the session's EntityMode to the mode that can generate the XML. Kind of nice.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Romi Dave
Greenhorn

Joined: Jul 19, 2006
Posts: 26
No I am not using Hibernate. Basically my requirement is, I need to generate XML file for some data fields on my page and then that XML file would be used in other application.
J Bhatt
Greenhorn

Joined: Jun 15, 2005
Posts: 20
You could try http://xstream.codehaus.org/manual-tweaking-output.html
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

I highly recommend using JDom then. It is easy to create an XML object with Java OO, then one command generates the XML from that object model of the xml.

Good Luck

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML file generation