Displaying 2 results from an estimated 2 matches for "feedxmlparser".
2006 Jun 24
1
Parsing XML with REXML problem
...ile
class Article
attr_accessor :id, :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'']...
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
...attr_accessor :id, :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|
p = Article.new
p.id = article.attributes[''ID'']
p.post = article.attributes[''POSTING_DATE'']...