xml - Conditional XPath matching -


i have xml looks this...

   <tbody>      <tr>        <td>          <h5>            <a class="foo" name="bar">this element want condition on.</a>          </h5>        </td>     </tr>     <tr>       <td>         <a href="/generic/generic">this element want match on</a>       <td>       <td></td>       <td></td>    </tr>   <tbody> 

how match on second first 's name attribute "bar", using xpath?

this expression work...

//tr[preceding-sibling::tr/td/h5/a/@name = 'bar']/td/a 

but there errors in xml. here's edited version:

<tbody>      <tr>        <td>          <h5>            <a class="foo" name="bar">this element want condition on.</a>          </h5>        </td>     </tr>     <tr>       <td>         <a href="/generic/generic">this element want match on</a>       </td>       <td></td>       <td></td>       <td></td>    </tr>   </tbody> 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -