Need Help accessing XML Elements with ASP/ADO

Discussion in 'XML' started by gmlear, Mar 18, 2005.

  1. gmlear

    gmlear Guest

    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
     
    gmlear, Mar 18, 2005
    #1
    1. Advertising

  2. gmlear

    earthling Guest

    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:<>...
    > 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
     
    earthling, Mar 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nita
    Replies:
    1
    Views:
    904
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    491
    Kevin Spencer
    Dec 17, 2004
  3. Replies:
    0
    Views:
    1,345
  4. Gerald Aichholzer
    Replies:
    2
    Views:
    2,617
    Gerald Aichholzer
    Jun 27, 2006
  5. Navin
    Replies:
    1
    Views:
    762
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page