Displaying 2 results from an estimated 2 matches for "get_newsfeed".
2006 Jun 24
1
Parsing XML with REXML problem
...post, :archive, :ntype, :head, :blurb, :body,
:fblurb, :fimage, :att, :source, :copy, :brand
end
# the base parser
class BaseXMLParser
def initialize(filename)
@raw_xml = File.open(filename).read
@newsfeed = []
end
end
# DOM-based parsing
class FeedXMLParser < BaseXMLParser
def get_newsfeed
doc = Document.new(@raw_xml)
XPath.each(doc, ''newsfeed/article'') do |article|
art = Article.new
art.id = article.attributes[''id'']
art.post = article.attributes[''posting_date'']
art.archive = article.attributes['...
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
...e, :head, :blurb, :body,
:fblurb, :fimage, :att, :source, :copy, :brand
end
# the base parser
class BaseXMLParser
def initialize(filename)
@raw_xml = File.open(filename).read
@newsfeed = []
end
end
# DOM-based parsing
class FeedXMLParser < BaseXMLParser
def get_newsfeed
doc = Document.new(@raw_xml)
XPath.each(doc, ''NEWSFEED/ARTICLE'') do |article|
p = Article.new
p.id = article.attributes[''ID'']
p.post = article.attributes[''POSTING_DATE'']
p.archive = article.attributes[...