wood burning stoves 2.0*
The moose likes Servlets and the fly likes Using servlets to convert XML to CSV file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Using servlets to convert XML to CSV file" Watch "Using servlets to convert XML to CSV file" New topic

Using servlets to convert XML to CSV file

Vi Manch

Joined: Sep 07, 2003
Posts: 3
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

Joined: Mar 22, 2000
Posts: 12759
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: Using servlets to convert XML to CSV file
Similar Threads
Display euro symbol in CSV with xml + xslt
Java Batch program - CSV/XML input file
Java Excel API - Help[ Needed
CSV to XML coding in Java
Trim space in XML