XPath evaluation support for absolute paths.

This commit is contained in:
Yorick Peterse 2014-07-09 09:28:00 +02:00
parent a398af19fe
commit 74130df40d
1 changed files with 14 additions and 0 deletions

View File

@ -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