1

次の XML フラグメントがあるとします。

<table>
  <tbody>
    <tr>
      <td>
        <strong>Specifications</strong>
      </td>
    </tr>
    <tr>
      <td>Finish</td>
      <td>Black</td>
    </tr>
    <tr>
      <td>Action</td>
      <td>Semi-Automatic</td>
    </tr>
    <tr>
      <td>Caliber</td>
      <td>7.62mmX39mm</td>
    </tr>
  </tbody>
</table>

trその下のテキストを含まないすべての要素を選択しようとしていますSpecificationsが、XPath が恐ろしく、正しく取得できません。私は試した

//table/tbody/tr[not(contains(text(),'Specifications'))]

しかし、それは明らかにまだtr含まれているノードを私に与えていますSpecifications

4

2 に答える 2