Select node, which contains descendants with specific attribute

xpath

Solution

`a` tag is not a child of `tr` tag, you can try this xpath:

//tr[.//a/@class='unread']

Or

//tr[descendant::a/@class='unread']

Problem

I have similiar structure to: ``` <tr> <td>I WANT THIS</td> <td> <a class="unread">text</a> </td> <td></td> </tr> <tr> <td></td> <td> <a class="read">text</a> </td> <td></td> </tr> ``` And I need to select `<tr>` node, which have `<a>` node with attribute `[@class='unread']`, to select inner `<td>` later. I tried `//tr[a/@class='unread']` and `//tr/a[@class='textMsg unread']` but didn't work. How can I get my `<tr>` node?

Original source