ドキュメントを見ると、目標は最初のテーブルの 2 行目の 2 番目のセルを選択することです。
次の式を作成しました。
//row/td[2]/text()[td[@class="identifier"]/span[text()="identifier"]]
ただし、行は返されません。残念ながら、何が悪いのかわかりません。
私には、それは大丈夫に見えます。式は次のようにする必要があります。
select the text
in the second cell
in any row
where
the text of a span equals to "identifier"
and the span is located in cell with a "identifier" class
私が間違っていることを指摘していただければ幸いです。
サンプル XML ドキュメント:
<?xml version="1.0"?>
<html>
<table class="first">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td class="identifier">
<span>identifier</span>
</td>
<td>
foo
<span>ignore</span>
bar
</td>
</tr>
<tr>
<td>row 3, cell 1</td>
<td>row 3, cell 2</td>
</tr>
</table>
<table class="second">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td class="identifier">
<span>not an identifier</span>
</td>
<td>
not a target
</td>
</tr>
<tr>
<td>row 3, cell 1</td>
<td>row 3, cell 2</td>
</tr>
</table>
</html>