Sha256: f12e682e504550c541984ac71b5f08d1fca2c0fdabc6451c1352df5e9c0abd2d
Contents?: true
Size: 878 Bytes
Versions: 21
Compression:
Stored size: 878 Bytes
Contents
module Nokogiri module Decorators module Hpricot #### # This mixin does custom adjustments to deal with _whyML module XPathVisitor def visit_attribute_condition node unless (node.value.first.type == :FUNCTION) or (node.value.first.value.first =~ /^@/) node.value.first.value[0] = "child::" + node.value.first.value[0] end super(node).gsub(/child::text\(\)/, 'normalize-space(child::text())') end # take a path like '//t:sam' and convert to xpath "*[name()='t:sam']" def self.xpath_namespace_helper rule rule.split(/\//).collect do |tag| if match = tag.match(/^(\w+:\w+)(.*)/) "*[name()='#{match[1]}']#{match[2]}" else tag end end.join("/") end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems