Last active
September 15, 2020 12:33
-
-
Save hadrienblanc/f22ed6759336070a4f21b91b8e0fd80a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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