Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using servlets to convert XML to CSV file

 
Vi Manch
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All-

I am developing an application using JSP/Servlets (Struts)and entity beans. I have a page wherein I display some information in the form of a XML file. I also need to display the same info in a CSV format. Can anyone help/guide me in how I can convert the XML file to a CSV format file.

-- Vishnu
(SCJP 1.4)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should start by trying to make a class that converts XML to your desired CSV format OUTSIDE the servlet environment. XML is complicated enough without mixing it with the servlet API.
All the XML toolkit you need is built into Java 1.4 and will be available in a servlet when you need it.
A good starting point is Sun's XML tutorial.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic