0

子ノードとして入力タグを使用して祖先がtdであるノードのテキストを選択したいと思います。

入力は次のとおりです。

<tr>
    <td width="1"><input type="checkbox" name="marketCodes" value="AE01" onclick="facetCheckboxClicked(this)"></td>
    <td style="padding-left:5px;padding-right:5px;">Defense &amp; Security&nbsp;(1028)</td>
    <td width="1"><input type="checkbox" name="marketCodes" value="AE02" onclick="facetCheckboxClicked(this)"></td>
    <td style="padding-left:5px;padding-right:5px;">Geotechnologies (96)</td>
    <td style="padding-left:5px;padding-right:5px;">Aircraft Products & Services (594)</td>
</tr>

期待される出力は次のとおりです。

 Defense &amp; Security&nbsp;(1028)
 Geotechnologies (96)
4

1 に答える 1

1

これはどう:

//td[preceding-sibling::td[1]/input]/text()
于 2012-09-25T06:52:26.867 に答える