just made a basic structure of a sax parser to speed this up

This commit is contained in:
booboy 2020-10-25 04:44:49 -05:00
parent 30badbe1dd
commit 73515707f7

36
rpm_to_cve_parser/sax_parser.rb Executable file
View file

@ -0,0 +1,36 @@
#!/usr/bin/env ruby
require 'ox'
class SaxParser < Ox::Sax
def initialize
@elements = []
end
def start_element(name)
#puts "start: #{name}"
end
def current_element
@elements.last
end
def end_element(name)
#puts "end: #{name}"
end
def attr(name, value)
#puts " #{name} => #{value}"
end
def text(value)
#puts "text: #{value}"
end
end
file = File.read('./rpm-to-cve.xml')
handler = SaxParser.new()
Ox.sax_parse(handler, file)