2
從這塊HTML的:XPATH:選擇以下同胞和自節點
<tbody>
<tr>
<tr id="1" class="first">
<tr id="2" class="">
<tr id="3" class="last">
<tr id="4" class="first">
<tr id="5" class="">
<tr id="6" class="last">
<tbody>
我正嘗試獲取XPath表達式返回所有TR [@類=「第一」的節點是隨後TR其中沒有「第一」類,包括第一個節點。在這種情況下的一組與TR的id 1,2,3,並與IDS 4,5 TR,6.
從來就試着使用:
//tbody/tr[@class='first']/self::* | following-sibling::tr[not(starts-with(@class, 'first'))]
沒有成功。對此有何想法?
感謝
謝謝,我會讓它去使用position()和一些PHP來代替 – steaktartar 2010-07-13 13:42:06