class Nokogiri::XML::Reader

but do not want to write a Document handler.
The Reader parser is good for when you need the speed of a SAX parser,
need during the first iteration.
document again. So make sure that you capture any information you
the cursor moves through the entire document, you must parse the
Note that Nokogiri::XML::Reader#each can only be called once!! Once
end
puts node.name
# node is an instance of Nokogiri::XML::Reader
reader.each do |node|
eoxml
</x>
<tenderlove:foo awesome=‘true’>snuggles!</tenderlove:foo>
<x xmlns:tenderlove=‘tenderlovemaking.com/’>
reader = Nokogiri::XML::Reader(<<-eoxml)
Here is an example of usage:
to an each block.
would move. The Reader is given an XML document, and yields nodes
Nokogiri::XML::Reader parses an XML document similar to the way a cursor
##

def attribute_nodes

Get a list of attributes for the current node
##
def attribute_nodes
  nodes = attr_nodes
  nodes.each { |v| v.instance_variable_set(:@_r, self) }
  nodes
end

def attributes

Get a list of attributes for the current node.
##
def attributes
  Hash[attribute_nodes.map { |node|
    [node.name, node.to_s]
  }].merge(namespaces || {})
end

def each

Move the cursor through the document yielding the cursor to the block
##
def each
  while cursor = self.read
    yield cursor
  end
end

def initialize source, url = nil, encoding = nil # :nodoc:

:nodoc:
def initialize source, url = nil, encoding = nil # :nodoc:
  @source   = source
  @errors   = []
  @encoding = encoding
end