Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML file generation

 
Romi Dave
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about the JAX-B API. You have the schema with you now you can generate the XML document.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Romi Dave
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic