Module: Nokogiri::Decorators::Hpricot::XPathVisitor

Defined in:
lib/nokogiri/decorators/hpricot/xpath_visitor.rb

Overview

This mixin does custom adjustments to deal with _whyML

Instance Method Summary collapse

Instance Method Details

#visit_attribute_condition(node) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/nokogiri/decorators/hpricot/xpath_visitor.rb', line 7

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