I want to check for a certain text in HTML, such as 'No Value', and if that exists then assign a 0 to it. Does anybody have any idea how to do that? (Google a lot but didn't find anything relevant)
<table>
<tr>
<td>
<h3>Money in account</h3>
</td>
<td>
<p>No Value</p>
</td>
</tr>
</table>
In XPath 2.0:
if (p = 'No Value') then 0 else p
In XPath 1.0 there's no obvious solution but there are some convoluted workarounds: it depends a bit on the context in which you are working (e.g. can you declare variables).
It's time to move to XPath 2.0.