diff --git a/lib/oga/xpath/evaluator.rb b/lib/oga/xpath/evaluator.rb index 1c5b190..e110788 100644 --- a/lib/oga/xpath/evaluator.rb +++ b/lib/oga/xpath/evaluator.rb @@ -39,6 +39,20 @@ module Oga end end + def process_all(nodes) + nodes.each do |node| + process(node) + end + end + + def on_absolute(node) + if @document.respond_to?(:root_node) + @context = XML::NodeSet.new([@document.root_node]) + end + + process_all(node.children) + end + def on_path(node) test, children = *node