This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def escape_single_quotes_for_xpath(string) | |
if string =~ /'/ | |
%[concat('] + string.gsub(/'/, %[', "'", ']) + %[')] # horribly, this is how you escape single quotes in XPath. | |
else | |
%['#{string}'] | |
end | |
end |