从xpath结果集访问第N个节点

时间:2012-09-11 11:28:00

标签: xml xpath xmlspy

  

可能重复:
  Get Nth child of a node using xpath

如何从以下设置访问第N个节点 XPath = / ProcessData / * [starts-with(name(),'INV')]

enter image description here

1 个答案:

答案 0 :(得分:4)

下面的表达将有助于

(/ProcessData/*[starts-with(name(), 'INV')])[5]

此处5可以替换为所需的值,以从选定(已过滤)的节点中获取第n个节点。