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 attributes

Returns:
  • (Hash) - Attribute names and values
def attributes
  attrs_hash = attribute_nodes.each_with_object({}) do |node, hash|
                 hash[node.name] = node.to_s
               end
  ns = namespaces
  attrs_hash.merge!(ns) if ns
  attrs_hash
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