finding an adjacent node in xml through xpath
- by kolosy
i have a deeply nested structure (actually parsing out xhtml, so lots of nasty), like so:
<tr>
<td>
<font id="blah">
stuff
</font>
</td>
</tr>
<tr>
<td>
more stuff
</td>
</tr>
and this repeats in a long table. i need an xpath expression that will select the second font tag (or rather it's text()). i was looking at the preceding-sibling axis, but something isn't quite working right.
something along the lines of (and pardon me if this is ridiculous, my xpath is rusty)
//tr[preceding-sibling::tr/td/font/b]/td/text()