I am having an XML file
25.00
2009-07-06 15:49:34.984
00001720
RJ
26.00
2009-07-06 16:04:16.156
00001729
SD
28.00
2009-07-06 16:05:04.375
00001721
I have to convert this XML into CSV file. I have heard we can do such thing using XSLT. How can i do this in Java ( with/without XSLT )?
解决方案
In pseudo code:
loop through the rows:
loop through all children of `Row`:
write out the text
append a comma
new line
That quick little loop will write a comma at the end of each line, but I'm sure you can figure out how to remove that.
For actually parsing the XML, I suggest using JDOM. It has a pretty intuitive API.