【问题标题】:xpath expression for xml response, need conditionxml响应的xpath表达式,需要条件
【发布时间】:2021-04-19 20:11:10
【问题描述】:

我有一个像下面这样的 xml ..

    <parent>
      <child>
        <f1>abh</f1>
        <f2>jb</f2>
      </child>
      <child>
        <f1>abh2</f1>
        <f2>jb2</f2>
      </child>
    </parent>

如何使用 xpath 表达式获取 f2 值为 jb2 的子项的 f1?

【问题讨论】:

    标签: xml xpath xmlmapper


    【解决方案1】:

    XPath

    /parent/child[f2="jb2"]/f1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-31
      • 1970-01-01
      • 1970-01-01
      • 2012-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多