xpath expression for xml response, need condition

89 Views Asked by At

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?

1

There are 1 best solutions below

0
On

XPath

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