Skip to content

Memory-efficient XML parser that yields Ruby objects

github.com/monterail
4 pointsszajbus2 comments
On HN

Comments

Nice one. But in few words - what makes it better than Nokogiri::XML::SAX::Document from which you inherit?

I wouldn't say it's better. saxy wraps around Nokogiri SAX Parser by implementing it's callbacks.

What I wanted to achieve is to take advantage of SAX parser (memory efficiency when used correctly) with as little preconfiguration as possible, because I often face one-off tasks that involve importing large XML files into database.

I've seen some implementations of SAX parsers, but they either missed the point by only using it's API under the hood and still returning all the results at once (thus not being memory-efficient at all) or required extensive configuration (which seems a waste for one-off imports).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.