XPath quotation characaters

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

XPath quotation characaters

Post by atom » Wed Mar 10, 2010 11:56 am

Hiya

I have a ranorex xpath for a window, whos title contains a single quote ' character
How can i escape that character in the xpath?

According to XPath 1.0 specification, attributes can be specified in double or single quotes
But it seems ranorex xpath only allows single quotes

e.g.
/form[@title='That's my window'] -> fails because of single quote in window title
/form[@title="That's my window"] -> doesnt work, but should according to xpath specification

Is there any function to take a string (window title), and escape all special xpath characters?

Cheers

[update]
/form[@title='That's my window'] -> also fails

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: XPath quotation characaters

Post by Support Team » Wed Mar 10, 2010 12:45 pm

Hi atom,
double quote should fix your problem! ;)
You can easily checkout yourself if you use Ranorex Spy and tracking e.g. a textbox with a quote in it and looking to the related xpath.

Best regards,
Christian
Support Team