java6 xml解析器,适用于Java的最佳XML解析器

对于需要读取和修改小容量(几MB)UTF-8编码的XML文件,推荐使用DOM4J作为解析器,它在处理速度不是首要考虑因素时表现出色。如果你追求速度,可以选择StAX解析器如Woodstox,但需要编写更多代码并习惯于流式处理XML。
摘要由CSDN通过智能技术生成

I need to read smallish (few MB at the most, UTF-8 encoded) XML files, rummage around looking at various elements and attributes, perhaps modify a few and write the XML back out again to disk (preferably with nice, indented formatting).

What would be the best XML parser for my needs? There are lots to choose from. Some I'm aware of are:

And of course the one in the JDK (I'm using Java 6). I'm familiar with Xerces but find it clunky.

Recommendations?

解决方案

If speed and memory is no problem, dom4j is a really good option. If you need speed, using a StAX parser like Woodstox is the right way, but you have to write more code to get things done and you have to get used to process XML in streams.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值