Class: XPath::DescendantIterator

Inherits:
AxisIterator show all
Defined in:
lib/xml/xpath.rb

Direct Known Subclasses

DescendantOrSelfIterator

Instance Method Summary collapse

Methods inherited from AxisIterator

#reverse_order?

Instance Method Details

#each(node, visitor) ⇒ Object



2613
2614
2615
2616
2617
2618
2619
2620
# File 'lib/xml/xpath.rb', line 2613

def each(node, visitor)
  stack = visitor.visit(node).children.reverse
  while node = stack.pop
    i = visitor.visit(node)
    stack.concat i.children.reverse
    yield i
  end
end