このような trs を持つテーブルがあります。
<tr>
<td><a href="http://www.mysite.com">Link</a></td>
<td>value 2</td>
<td>value 3</td>
<td>value 4</td>
<td>value 5</td>
</tr>
xPath を使用してすべてを選択し<tr>、それらをループしています。
foreach($xpathResult as $item){
//print the href of the first td
//print the nodeValue of the second td
//print the nodeValue of the 3rd td
//print the nodeValue of the 4th td
//print the nodeValue of the 5th td
}
nodeValue最初の td の href とその後の各 tdを出力するにはどうすればよいですか? firstChildとがありますlastChildが、どうすれば真ん中の s にたどり着けますか? firstChild->nextSiblingandを使用できますfirstChild->nextSibling->nextSiblingが、もっと簡単な方法はありませんか?