G
gordon.lear
I am using MSXML 4.0
I am grabbing numerous RSS News Feeds and trying to parse the data and
read it into a dB. The problem is that the RSS News feeds are not all
the same when tunneled down in the item element.
They ALL contain the nodes: title, description, link and pubDate. But
they come in all different orders and have other child nodes sandwiched
among the ones I am after.
<channel>
<item>
<title>
<description>
<link>
<pubDate>
example: http://rss.news.yahoo.com/rss/elections
example: http://www.cbsnews.com/feeds/rss/main.rss
example: http://rss.cnn.com/rss/si_topstories.rss
My code issue is;
When looping through the recordset I have to reference the childnode
numerically ie. item.childnodes.item(0).text,
item.childnodes.item(1).text, item.childnodes.item(2).text
But because I am trying to use the same code for every feed I want to
access the childnodes by their names: item.childnodes.item(title).text,
item.childnodes.item(description).text, item.childnodes.item(link).text
because in some feeds 0=title and in others 0=link etc etc...
I have spent three days searching the net and have not found anything.
Does anyone have a way to do this?
For those that want to give me their .Net solution I am sad to say it
must be done using ASP/ADO.
Please show me the way!!
||
-Gordon
glearATgmail.com
I am grabbing numerous RSS News Feeds and trying to parse the data and
read it into a dB. The problem is that the RSS News feeds are not all
the same when tunneled down in the item element.
They ALL contain the nodes: title, description, link and pubDate. But
they come in all different orders and have other child nodes sandwiched
among the ones I am after.
<channel>
<item>
<title>
<description>
<link>
<pubDate>
example: http://rss.news.yahoo.com/rss/elections
example: http://www.cbsnews.com/feeds/rss/main.rss
example: http://rss.cnn.com/rss/si_topstories.rss
My code issue is;
When looping through the recordset I have to reference the childnode
numerically ie. item.childnodes.item(0).text,
item.childnodes.item(1).text, item.childnodes.item(2).text
But because I am trying to use the same code for every feed I want to
access the childnodes by their names: item.childnodes.item(title).text,
item.childnodes.item(description).text, item.childnodes.item(link).text
because in some feeds 0=title and in others 0=link etc etc...
I have spent three days searching the net and have not found anything.
Does anyone have a way to do this?
For those that want to give me their .Net solution I am sad to say it
must be done using ASP/ADO.
Please show me the way!!
||
-Gordon
glearATgmail.com