Java JAXB 与 Apache XMLBeans
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1362030/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JAXB vs Apache XMLBeans
提问by Simon
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger than 10Mb?
考虑到大于 10Mb 的文件的性能,任何人都可以告诉我哪个更好(JAXB 或 Apache XMLBeans)?
采纳答案by Bruno Sim?es
Both have similar performances, however even if Apache XMLBeans seems to present better performance, I normally choose JAXB because I don't want to increase the size of my applications with 3rd party tools.
两者都有相似的性能,但是即使 Apache XMLBeans 似乎表现出更好的性能,我通常还是选择 JAXB,因为我不想使用 3rd 方工具增加应用程序的大小。
With Apache XMLBeans you need a small package around 2mb, it's probably easy to learn and well documented. Have full support of XSD specification and namespaces, and mapping only via XML Schema Definition (XSD). It also seems to use deprecated API's.
使用 Apache XMLBeans,您需要一个大约 2mb 的小包,它可能很容易学习并且有据可查。完全支持 XSD 规范和命名空间,并且仅通过 XML 架构定义 (XSD) 进行映射。它似乎也使用了已弃用的 API。
回答by Nico
agree with bruno. JAXB is bundled with Java for a reason
同意布鲁诺。JAXB 与 Java 捆绑在一起是有原因的
回答by dogbane
I prefer XMLBeans, because it comes with a handy tool called "inst2xsd" which allows you to generate an XML schema from an XML instance document. JAXB is not able to do this.
我更喜欢 XMLBeans,因为它带有一个名为“inst2xsd”的方便工具,它允许您从 XML 实例文档生成 XML 模式。JAXB 无法做到这一点。
See http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html#inst2xsd
见http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html#inst2xsd
回答by Roger Weber
The architect of XmlBeans wrote about why he chose to build XmlBeans, even though JAXB was the established standard. Take a look at his blog, specifically the problems with jaxbThe most compelling advantage was type substitution.
XmlBeans 的架构师写了他为什么选择构建 XmlBeans,即使 JAXB 是既定的标准。看看他的博客,特别是jaxb的问题最引人注目的优势是类型替换。