This project has moved. For the latest updates, please go here.

Escaping XPath expression strings as arguments to method calls

May 13, 2015 at 3:47 PM
Hello all:

Is it possible to escape XPath-related string? For example, "//table[@id=''ct_lookup"]/descendant::tr[last()]/th[2]/descendant::button[@type="submit"]". I've been trying a few different escape sequences but it seems to choke in either the EE or Antlr.

Thanking all who respond in advance!
May 14, 2015 at 1:47 AM

I noticed that the double-quotes before ct_lookup are actually two single quotes.

Your string is "//table[@id=''ct_lookup"]/descendant::tr[last()]/th[2]/descendant::button[@type="submit"]"

This should probably be a double-quote

It seems I am not properly unescaping stings in EE. This probably has been a bug for a long while but I never really got around to checking it. I'll have a fix soon.

May 14, 2015 at 2:35 PM
Oops! Yeah, sorry about that :). It looks like I copied a string in 'mid-escape'.

Thanks for the work you've done on the library! It really is helpful and you do a great job involving yourself with peoples' questions. I'll look for the fix when it comes out.
May 15, 2015 at 11:43 PM
This has been fixed in the latest version 2.0.3. Thanks!
May 15, 2015 at 11:44 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.