Apply node() type tests to the document too.
When running XPath queries such as "self::node()" the result should be a set containing the document itself. This in turn fixes expressions such as descendant-or-self::node()/a.
This commit is contained in:
1 parent
1f3b4cb2fb
commit
602f2fe8bb
2 files changed
+15
-1
No files matched your search
@@ -550,7 +550,9 @@ module Oga
|
||||
nodes = XML::NodeSet.new
|
||||
|
||||
context.each do |node|
|
||||
nodes << node if node.is_a?(XML::Node)
|
||||
if node.is_a?(XML::Node) or node.is_a?(XML::Document)
|
||||
nodes << node
|
||||
end
|
||||
end
|
||||
|
||||
return nodes
|
||||
|
||||
Reference in new issue
Block a user