对于以下XML:的Java XPathExpression的子元素使用父元素的XPath参数
<books>
<book>
<author>Peter</author>
<title>Tales from Somewhere</title>
<data>
<version>1</version>
</data>
</book>
<book>
<author>Paul</author>
<title>Tales from Nowhere</title>
<data>
<version>2</version>
</data>
</book>
</books>
我怎样才能得到这本书的作者“保罗”上面的<version>
值,使用这种类型的符号来构建Java XPathExpression:
//*[local-name()='books']/*
?
我用以下问题作为参考: Get first child node in XSLT using local-name()
谢谢!
[XPath for Child Element使用父元素作为XPath参数的可能重复r](http://stackoverflow.com/questions/21034950/xpath-for-child-element-using-parent-element-as-xpath-parameter) – 2014-01-10 02:16:16
自身的重复? – fuzzyanalysis
你提交了两次。 – 2014-01-10 02:19:46