Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
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