XmlBeans 与 Digester 哪个更擅长处理巨大的 xml 文件?
我正在创建一个 Web 服务,它将解析来自不同请求的巨大 xml 文件。我正在探索不同的 xml 解析器,从中我读到了 XmlBeans 和 Digester 易于使用且非常高效。我觉得 Digester 比 XmlBeans 更容易,但是从 XmlBeans 的文档中我了解到它使用 Saxon 8.6.1,它是由 CERN 所以它一定比 Digester 更好。
那么对于这种情况,我应该选择 XmlBeans 还是 Digester?
I am creating a webservice which is going to parse huge xml files from different requests. I was exploring different xml parsers from which I read about XmlBeans and Digester would be easy to use and are very efficient. I felt Digester easier than that of XmlBeans but from documentation of XmlBeans I came to know that it uses Saxon 8.6.1 which is prepared by CERN so it must be better than that of Digester.
So which one should I go with XmlBeans or Digester for this scenario ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,如果您有非常大的 XML 文件,那么我不推荐它们中的任何一个。对于高性能 XML 处理,还有其他解决方案,甚至是自定义解析器,它们至少比您描述的解决方案好一个数量级。为大型 XML 文件选择什么还部分取决于您拥有的资源:更多内存还是更多 CPU。
例如 http://vtd-xml.sourceforge.net/ 可能是一种快速替代方案,但有还有很多其他的,因此如果您的应用程序的性能至关重要,那么您确实需要将它们与您自己的实际条件下的一些测试进行比较。
Well, if you have really huge XML files, than I don't recommend either of them. For high performance XML processing there are other solutions, or even custom parsers that are at least an order of magnitude better than those you describe. What to choose for huge XML files also depends partially on what you have: more memory or more CPU.
E.g. http://vtd-xml.sourceforge.net/ might be one fast alternative, but there are many others, so if your application's performance is critical, than you really need to compare them with some tests under your own realistic conditions.