# File lib/nokogiri/decorators/hpricot/node.rb, line 30 def convert_to_xpath(rule) rule = rule.to_s case rule when %r{^//} [".#{Hpricot::XPathVisitor.xpath_namespace_helper(rule)}"] when %r{^/} [Hpricot::XPathVisitor.xpath_namespace_helper(rule)] when %r{^.//} [Hpricot::XPathVisitor.xpath_namespace_helper(rule)] else visitor = CSS::XPathVisitor.new visitor.extend(Hpricot::XPathVisitor) CSS.xpath_for(rule, :prefix => ".//", :visitor => visitor) end end