Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Need Help accessing XML Elements with ASP/ADO

Reply
Thread Tools

Need Help accessing XML Elements with ASP/ADO

 
 
gmlear
Guest
Posts: n/a
 
      03-18-2005
Yes this looks just like the post below but seeing a was a dumba$$ and
didn't phrase my subject in the form of a question I wasn't gettting
any hits.... So here you go.

Senerio:

I am using MSXML 4.0 , ASP & ADO


I am grabbing numerous RSS News Feeds and trying to parse the data and
insert it into a dB. The problem is that the RSS News feeds are not
all the same when 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/r*ss/main.rss
example: http://rss.cnn.com/rss/si_tops*tories.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).te*xt,
item.childnodes.item(descripti*on).text,
item.childnodes.item(link).tex*t
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!!


>>>-----O--------> E



-Gordon

 
Reply With Quote
 
 
 
 
earthling
Guest
Posts: n/a
 
      03-19-2005
Gordon,

what you need to do is simple parsing. How about looking at the name
of the node? See property localname of XMLNode or the derived class
XMLElement

Giancarlo

"gmlear" <> wrote in message news:< roups.com>...
> Yes this looks just like the post below but seeing a was a dumba$$ and
> didn't phrase my subject in the form of a question I wasn't gettting
> any hits.... So here you go.
>
> Senerio:
>
> I am using MSXML 4.0 , ASP & ADO
>
>
> I am grabbing numerous RSS News Feeds and trying to parse the data and
> insert it into a dB. The problem is that the RSS News feeds are not
> all the same when 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/=ADelections
> example: http://www.cbsnews.com/feeds/r=ADss/main.rss
> example: http://rss.cnn.com/rss/si_tops=ADtories.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).te=ADxt,
> item.childnodes.item(descripti=ADon).text,
> item.childnodes.item(link).tex=ADt
> because in some feeds 0=3Dtitle and in others 0=3Dlink 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!!=20
>
>
> >>>-----O--------> E=20

>
>
> -Gordon

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How *build* new elements and *replace* elements with xml.dom.minidom? Chris Seberino Python 3 06-12-2009 05:08 AM
replacing xml elements with other elements using lxml Ultrus Python 4 08-30-2007 07:17 AM
XML elements to JavaScript Array elements Conversion P XML 1 07-07-2006 09:08 PM
XSLT: iterating all child elements and accessing homonymous childrenin sibling elements Gerald Aichholzer XML 2 06-27-2006 03:46 PM
Accessing XML elements by name with ASP gordon.lear@gmail.com XML 3 03-20-2005 12:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57