aspose file tools*
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 Java 8 in Action this week in the Java 8 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
Author

Using servlets to convert XML to CSV file

Vi Manch
Greenhorn

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
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
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


Java Resources at www.wbrogden.com
 
 
subject: Using servlets to convert XML to CSV file
 
Similar Threads
Java Batch program - CSV/XML input file
CSV to XML coding in Java
Display euro symbol in CSV with xml + xslt
Java Excel API - Help[ Needed
Trim space in XML