| Author |
Topic Search Topic Options
|
rhysa
Newbie
Joined: 02 September 2003
Location: United States
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Topic: RSS Into Database Posted: 02 September 2003 at 8:42am |
Hi everyone,
I've starting playing with XML and I've seen some great examples to parse XML and RSS documents to display the headlines on a table. However, I'm stuck with something : I'd like to know how to insert the RSS items into a database.
I mean, most of the samples just take the RSS Newsfeed and parse it through an XSL to display it, but what I want to achieve is to take the <TITLE>, <LINK> and <DESCRIPTION> items from the newsfeed and insert them into a database table (title,link, description).
I'm really stuck and I'm new here  Any help would be greatly appreaciated
Thanks!
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 September 2003 at 11:45am |
first off.. one of the purposes of RSS is to avoid database interaction
none the less.. all you would do it work through the XML document and instead of displaying it, build a SQL statement http://forums.webwiz.net/forum_posts.asp?TID=5360&PN=1
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
rhysa
Newbie
Joined: 02 September 2003
Location: United States
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 September 2003 at 12:36pm |
MorningZ wrote:
first off.. one of the purposes of RSS is to avoid database interaction
|
Yes, you are right. But in this case, I need to save that information syndicated from an external source into a database.
I apprecaite your sample, however what it does is a transformation to display it directly on the web page.
What I'd really like to see is a sample that walks the RSS Newsfeed taking each of the required items (title, description and link) and placing it into variables (so that a sql statement could be built later)
This is the first time that I approach this technology (XML) and I'm not sure of how to achieve what I'm trying
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 September 2003 at 12:49pm |
the link and sample i provided above has nothing to do with XML per se....
but as said in my reply (and echoed in the comment: "I apprecaite your sample, however what it does is a transformation to display it directly on the web page").. so instead of Response.Write-ing the value, then save it in a variable or something and build up a SQL statement to do the database insert.... no one says you have to display the data gathered from the RSS document, that sample above is more or less code to be able to parse/process the XML document, displaying it is just the end of the road for it....
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
rhysa
Newbie
Joined: 02 September 2003
Location: United States
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 September 2003 at 1:07pm |
Dear MorningZ, thanks a lot for helping me :
MorningZ wrote:
instead of Response.Write-ing the value, then save it in a variable or something and build up a SQL statement to do the database insert |
after looking at your code, there's only one response.write which displays the full HTML once the XML is transformed. It is not taking each element (which is what i want to achieve).
What I'm currently looking, is something like this :
- Open the XML document (URL)
- Get the ITEMS nodes
- Walk through the ITEMS nodes like this (Loop or for each) :
link=Link from the current node title=title from the current node description=descriptionfrom the current node
If you see, I'm taking the document and just selecting it's ITEMS and then taking some of its subnodes (specifically link,title,description) and storing them on a variable.
I'm not sure if I'm being clear. Thanks for your patience 
|
 |
rhysa
Newbie
Joined: 02 September 2003
Location: United States
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 September 2003 at 3:50pm |
Any suggestions?
I'm going crazy with this and I don't seem to find a working sample
  
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 September 2003 at 4:14pm |
yeah, go learn the commands "selectNodes" and "selectSingleNode"
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/xmlsdk30/htm/xmmthselectnodes.asp
you seem to not have much interest in learning this yourself... not sure if you expect someone to code the whole thing for you
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
rhysa
Newbie
Joined: 02 September 2003
Location: United States
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 September 2003 at 4:39pm |
Thanks for the harsh reply. Rude but useful, I'll never ask anything here again
|
 |