Sha256: 70429cd04b4e14b719889601caf5a409672e25d1eb1de6724d69be5bf2c66267

Contents?: true

Size: 448 Bytes

Versions: 11

Compression:

Stored size: 448 Bytes

Contents

# encoding: utf-8
module Watir
  module XpathSupport

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

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

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

  end # XpathSupport
end # Watir

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
watir-webdriver-0.7.0 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.11 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.10 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.9 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.8 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.7 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.6 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.5 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.4 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.3 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.2 lib/watir-webdriver/xpath_support.rb