xpath 2.0 for java可能 [英] xpath 2.0 for java possible
问题描述
javax.xml.xpath
是XPath 1.0。是和 org.w3c.dom
正确的方法,或者有更现代化的实现? org.w3c.dom
非常尴尬,JDOM似乎更容易。
p> 您可以考虑基于Java的XPath 2.0或XQuery实现(XSLT 2.0选项提供更强大的功能),例如 Saxon 9.x 。
Saxon是开放源码,是目前为止最高质量的基于java的处理器之一,我正在使用它每天在回答SO XSLT / XPath / XQuery问题时。在文档中您将找到很好的代码示例。
我所知道的唯一独立的XPath 2.0实现是 PsychoPath ,但我不确定其质量和可用性。
What package shall I use for XPath? I want wo query for elements and then extract some values around these nodes. Maybe one or more levels higher, some attributes.
javax.xml.xpath
is XPath 1.0. Is javax.xml.xpath
and org.w3c.dom
the right way to go, or are there more modern implementations? org.w3c.dom
is very awkward, JDOM seems alot easier.
You may consider a Java-based XPath 2.0 or XQuery implementation (the XSLT 2.0 choice provides much more powerful functionality), such as Saxon 9.x.
Saxon is open source and one of the highest quality java-based processor so far and I am using it on a daily basis when answering SO XSLT/XPath/XQuery questions. In the documentation you will find good code examples.
The only stand-alone XPath 2.0 implementation I am aware of is PsychoPath, but I am not sure of its quality and usability.
这篇关于xpath 2.0 for java可能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!