How to compare an value using xpath?
i am currently doing java and html, i have to check some values from the website against my database. i would like to ask if XPATH has such function like "is text present" or "get text = data" rather than get element, is there something to check if the value is there or something?
You can use boolean method in XPath.
For example, lets say your XML is this
<?xml version="1.0" > <persons> <person> <name>Peter</name> <sex>MALE</sex> <age>25</age> </person> </persons>
You can use the boolean method as,
boolean(/persons/person[name = 'Peter'])