java实现cvs转xml,我们如何将XML文件转换为CSV?

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值