0
votes

I am trying to understand what is wrong but I can't. I have used XPath so many times in my code, but this time I keep getting the error

Expected end of statement

without an obvious reason.

The error seems to be occurred because of the simple XPath:

xpathId = ".//h2[contains(.,'"&Identifier&"')]"

Identifier is a variable that is set when the function is called:

Function Test(Identifier)
1
What is the value of Identifier when the error occurs?Ansgar Wiechers
As above. If Identifier contains a single quote (for example) then it will mess up your closing quote and generate this error.Dave
Did you check/count your end ifs and other block terminators?Trimble Epic

1 Answers

0
votes

Did you try this:

xpathId := ".//h2[contains(.,'"&Identifier&"')]"