Viewing source, I have table data formatted exactly like this:
<tr class="even">
<td>apple</td>
<td>pear</td>
<td>ora开发者_如何学运维nge</td>
</tr>
<tr class="odd">
<td>apple</td>
<td>pear</td>
<td> </TD>
</tr>
<tr class="even">
<td>apple</td>
<td>pear</td>
<td>orange</td>
</tr>
How would I go about not matching the <td>
containing   in all rows where it occurs?
The entity
isn't something that XPath knows about -- it is best to use its equivalent (self-defining) character entity  
To select all td
s of a top element - table
, that do not contain
use:
/table/tr/td[not(contains(., ' '))]
To select all rows of this table such that none of their td
children contains
use:
/table/tr[not(td[contains(., ' ')])]
To select all td
children of all rows of this table such that none of their td
children contains
use:
/table/tr[not(td[contains(., ' ')])]/td
精彩评论