I am using XPATH 2.0 in WSO2 Developer studio to perform some transformations on data in Payload Mediator. In one transformation i have to check that if an element exists in the legacy service response then print 'Yes,it does' otherwise 'No,it don't'.
I am using the following syntax.
if(fn:exists(//*/*[local-name()='HomePhone'])) then fn:concat('Yes','it does')
else fn:concat('No','it dont')
It is giving me following error message.
I am confused about syntax. What's the correct way of using If/else in Xpath 2.0 in my particular scenario?
Note: "fn:concat" function works fine on it's own.