【问题标题】:access Nth node from xpath result set [duplicate]从xpath结果集中访问第N个节点[重复]
【发布时间】:2012-09-11 11:27:59
【问题描述】:

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

如何访问以下集合中的第 N 个节点。
XPath = /ProcessData/*[starts-with(name(), 'INV')]

【问题讨论】:

    标签: xml xpath xmlspy


    【解决方案1】:

    下面的表达会有所帮助

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-25
      • 2022-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-06
      • 2011-12-10
      • 2011-10-11
      相关资源
      最近更新 更多