Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
reading huge, large xml in ruby made easy
branch: master
Failed to load latest commit information.
examples elements_lookup is optional
README adding a note of ox example
reading_huge_xml.rb few corrections

README

HugeXML.read xml, elements_lookup do |element|
  # => element{ :name, :value, :attributes}
end

OR simply

HugeXML.read xml do |element|
# this will catch all opening elements

You can have some more control as

HugeXML.read xml, elements_lookup do |element, reader|

Here reader represents (Nokogir)pointer/cursor (but not actually itself is) which keeps on moving as we keep
on reading file stream. and has the following methods for us

element = reader.try_next elements
element = reader.try_next_with_value elements
element = reader.try_next_with_attributes elements

Note* use reader on trial basis :)

I just got one more similar example using ox
https://gist.github.com/amolpujari/5966431









Something went wrong with that request. Please try again.