Is there any XPath pattern that can choose all the html code except the last node? For example , lets say i want all the paragraphs inside the body except the last one in this HTML code: I tried these patterns which returned a null value or error in the expression (I'm using the HAP Testbed v1.1.0.0 to test the patterns on the HTML code):
//body//p[last()] != true
not(//body//p[last()])
//body//not[p[last()]]
- etc...
Question:
- Does
not()
function return a boolean value? - If not, how can I use it for my purpose? - Is there any other way to get all the text except the last node?