search for: get_parser

Displaying 2 results from an estimated 2 matches for "get_parser".

Did you mean: set_parser
2006 Jun 24
1
Parsing XML with REXML problem
...cle.elements[''brand''].text @newsfeed << art end @newsfeed end end ##### benchmark (lets see if its working) test.. require ''benchmark'' # factory to instantiate parser instance and parse test file # klass: the class of parser to use def get_parser(klass) lambda do parser_inst = klass.new(''newsfeed.xml'') parser_inst.get_newsfeed end end docparser = get_parser(FeedXMLParser) iterations = 10 Benchmark.bm do |x| x.report { for i in 1..iterations; docparser.call; end } end # display the results art docparser.cal...
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
....copy = article.elements[''COPYRIGHT''].text p.brand = article.elements[''BRAND''].text @newsfeed << p end @newsfeed end end # factory to instantiate parser instance and parse test file # klass: the class of parser to use def get_parser(klass) lambda do parser_inst = klass.new(''newsfeed.xml'') parser_inst.get_newsfeed end end docparser = get_parser(FeedXMLParser) #puts docparser.call.inspect {|x| x.each {|z| puts z}} class ArcticleLoad attr_reader :id, :post, :archive, :ntype, :head, :blurb,...