Module: Watir::XpathSupport

Included in:
Container
Defined in:
lib/watir-webdriver/xpath_support.rb

Class Method Summary collapse

Class Method Details

.downcase(value) ⇒ Object



15
16
17
# File 'lib/watir-webdriver/xpath_support.rb', line 15

def self.downcase(value)
  "translate(#{value},'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"
end

.escape(value) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/watir-webdriver/xpath_support.rb', line 4

def self.escape(value)
  if value.include? "'"
    parts = value.split("'", -1).map { |part| "'#{part}'" }
    string = parts.join(%{,"'",})

    "concat(#{string})"
  else
    "'#{value}'"
  end
end