Abhishek Kakkerla
Abhishek Kakkerla

Reputation: 63

xpath expression for xml response, need condition

I have an xml like below ..

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

How do i get the f1 of child which has f2's value as jb2 using xpath expression?

Upvotes: -1

Views: 76

Answers (1)

Yitzhak Khabinsky
Yitzhak Khabinsky

Reputation: 22311

XPath

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

Upvotes: 2

Related Questions