I have some xml that looks like this…
<tbody>
<tr>
<td>
<h5>
<a class="foo" name="bar">This is the element I want to condition on.</a>
</h5>
</td>
</tr>
<tr>
<td>
<a href="/generic/generic">This is the element I want to match on</a>
<td>
<td></td>
<td></td>
</tr>
<tbody>
How do I match on the second only the first ‘s name attribute is “bar”, using xpath?
This expression will work…
But there are also some errors in the XML. Here’s an edited version: