Java SE平台上XML解析API的比较 [英] Comparison of XML parsing APIs on the Java SE platform
问题描述
我目前正在开发一个RSS提要阅读器,我想知道哪种XML解析API最适合它。 (请注意,我不是在寻找Feed解析器库 - 它只是关于XML API研究的起点)
I am currently developing an RSS feed reader, and I am wondering which XML parsing API would be the best fit for that. (Please note that I am not looking for a Feed parser library - it is merely the starting point for that research about XML APIs)
我正在寻找一个Java平台上的各种XML解析API,重点关注以下标准:
I am looking for a rundown of the various XML parsing APIs on the Java platform, focusing on the following criteria:
- 易于配置
- 配置是否在单独的文件中?
- 是否有合理的默认值?
- 节点导航 - 兄弟姐妹,孩子,父母。
- 访问/操作命名空间,属性,文本。
- 类层次结构是否经过深思熟虑或自然?
- 遇到无效字符(在编码或XML规范中禁止)
- 树结构无效(例如,因为未转义的HTML标签)
以下是一些我认为有用但不重要的信息:
Here is some information that I would consider useful though not crucial:
- 性能比较
- 可用实现列表
我正在考虑JVM上的任何XML API。
I am currently considering any XML API on the JVM.
- 它可以是Java标准(DOM,SAX,StAX,JAXP)或im特定于plementation的API。
- 它可以是JVM上任何语言的API(Scala,Groovy,Jython,JRuby ......) - 只需确保它与标准Java API。
我认为构建这个线程的一个好方法是每个答案只有一个API。
I believe that a good way to structure this thread would be to only have one API per answer.
推荐答案
看这里,你会得到一把!
http://www.xml.com/pub/rg/Java_ParsersLook here, you'll get a handful! http://www.xml.com/pub/rg/Java_Parsers
但是,我见过一些朋友在他们的项目中使用这个。虽然JAXP被广泛使用,但这个看起来很有希望。
But, I had seen some of my friends using this one in their projects. Though JAXP is widely used, this one looks promising.
Apache Xerces解析器版本1.2.3( http://xerces.apache.org/xerces-j/ )
Apache Xerces parser version 1.2.3 (http://xerces.apache.org/xerces-j/)
这篇关于Java SE平台上XML解析API的比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!