This project has moved and is read-only. For the latest updates, please go here.

Escaping XPath expression strings as arguments to method calls

May 13, 2015 at 4: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 2:47 AM
Hi,

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.

Thanks!
May 14, 2015 at 3: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 16, 2015 at 12:43 AM
This has been fixed in the latest version 2.0.3. Thanks!
May 16, 2015 at 12:44 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.