Skip to content

Instantly share code, notes, and snippets.

@hadrienblanc
Last active September 15, 2020 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadrienblanc/f22ed6759336070a4f21b91b8e0fd80a to your computer and use it in GitHub Desktop.
Save hadrienblanc/f22ed6759336070a4f21b91b8e0fd80a to your computer and use it in GitHub Desktop.
class MyParser < Nokogiri::XML::SAX::Document
def initialize
end
def start_element(name, attrs = [])
puts attrs.inspect
end
def characters(string)
end
def end_element(name)
end
end
xml_filename = './big_file.xml'
Nokogiri::XML::SAX::Parser.new(MyParser.new).parse(File.open(xml_filename))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment