Displaying 2 results from an estimated 2 matches for "parser_inst".
2006 Jun 24
1
Parsing XML with REXML problem
...#39;].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.call
Here is a snippet of xml that i...
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
...;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, :body,
:fblurb, :fimage, :att, :so...