module Qti::XPathHelpers
Public Instance Methods
rtype_predicate(ver, rsc_type)
click to toggle source
# File lib/qti/xpath_helpers.rb, line 11 def rtype_predicate(ver, rsc_type) # XPath 2.0 supports ends-with, which is what substring is doing here. # It also support regex matching with matches. # We only have XPath 1.0 available. cc_match = "starts-with(@type, '#{ver}') and " + xpath_endswith('@type', rsc_type) qti_match = "@type='#{ver}'" "#{qti_match} or (#{cc_match})" end
xpath_endswith(tag, tail)
click to toggle source
# File lib/qti/xpath_helpers.rb, line 7 def xpath_endswith(tag, tail) "substring(#{tag}, string-length(#{tag}) - string-length('#{tail}') + 1) = '#{tail}'" end
xpath_resource(type = '')
click to toggle source
# File lib/qti/xpath_helpers.rb, line 3 def xpath_resource(type = '') "//xmlns:resources/xmlns:resource#{type}" end