Support for the XPath child axis.
This commit is contained in:
1 parent
ec08b41737
commit
a0ecba6321
3 files changed
+76
-1
No files matched your search
@@ -150,7 +150,7 @@ module Oga
|
||||
while has_parent?(xml_node)
|
||||
xml_node = xml_node.parent
|
||||
|
||||
if node_matches?(xml_node, node)
|
||||
if can_match_node?(xml_node) and node_matches?(xml_node, node)
|
||||
nodes << xml_node
|
||||
break
|
||||
end
|
||||
@@ -206,6 +206,17 @@ module Oga
|
||||
return nodes
|
||||
end
|
||||
|
||||
##
|
||||
# Evaluates the `child` axis. This simply delegates work to {#on_test}.
|
||||
#
|
||||
# @param [Oga::XPath::Node] node
|
||||
# @param [Oga::XML::NodeSet] context
|
||||
# @return [Oga::XML::NodeSet]
|
||||
#
|
||||
def on_axis_child(node, context)
|
||||
return on_test(node, context)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a node set containing all the child nodes of the given set of
|
||||
# nodes.
|
||||
|
||||
Reference in new issue
Block a user