Support for the XPath pipe operator.
This commit is contained in:
1 parent
d1735750c1
commit
2817784e6b
2 files changed
+76
No files matched your search
@@ -509,6 +509,20 @@ module Oga
|
||||
return nodes
|
||||
end
|
||||
|
||||
##
|
||||
# Processes the pipe (`|`) operator. This operator creates a union of two
|
||||
# sets.
|
||||
#
|
||||
# @param [Oga::XPath::Node] ast_node
|
||||
# @param [Oga::XML::NodeSet] context
|
||||
# @return [Oga::XML::NodeSet]
|
||||
#
|
||||
def on_pipe(ast_node, context)
|
||||
left, right = *ast_node
|
||||
|
||||
return process(left, context) + process(right, context)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a node set containing all the child nodes of the given set of
|
||||
# nodes.
|
||||
|
||||
Reference in new issue
Block a user