Page 1 of 1

xpath comparison for string

PostPosted: Thu Apr 07, 2016 6:08 pm
by shlgw1
I would like to compare the value of a variable in a conditional statement using XPATH

The field contain the sex and we would like to display "Male" when the value is M and "Female" when the value is F

We have used the following conditional statement

/cats[1]/cat[1]/sex[1] = "M" but nothing was displayed when the input is M

We have tried to change the comparison from string to a number.

/cats[1]/cat[1]/sex[1] = 1 works when the value of sex = 1

The document is attached for your reference. Thank you.