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]
This is the union of Reader#attribute_hash and Reader#namespaces
Get the attributes and namespaces of the current node as a Hash.
def attributes attribute_hash.merge(namespaces) end
def each
##
def each while (cursor = read) yield cursor end end
def initialize(source, url = nil, encoding = nil) # :nodoc:
def initialize(source, url = nil, encoding = nil) # :nodoc: @source = source @errors = [] @encoding = encoding end