XPATH 选择根元素 [英] XPATH selecting the root element
本文介绍了XPATH 选择根元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种简单的方法可以在任何给定的上下文中移回根节点.我正在处理的 XML 文档非常大,需要使用 ../.. 大约十几次!!
Is there a simple way of moving back to the root node within any given context. The XML document I'm working with is extremely large and would require using ../.. about a dozen times!!
非常感谢大家的帮助.
推荐答案
我猜你在这里是谓词?并想返回以查看树更高层的数据以适应您的情况?
I'm guessing you are in a predicate here? and want to return to look at data higher up the tree for your condition?
您应该能够从前导/开始,然后再往下工作例如
You should be able to start with a leading / and then work your way back down e.g
/vehicles/cars/car[@id = /vehicles/featuredVehicle/@id]
这篇关于XPATH 选择根元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文