Forum Moderators: open

Message Too Old, No Replies

RSS Feed with ASP

how to display an rss feed on .asp page

         

bhartzer

4:47 pm on Nov 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have .asp pages on a site where I want to display a rss feed--the latest headlines from a niche industry. I want to keep the page fresh with those latest headlines.

I am familiar with using Carp on a .php page but how do I do it in .asp? Is there a similiar script?

(It's not .NET, just .asp if that helps.)

duckhunter

12:27 am on Nov 3, 2004 (gmt 0)

10+ Year Member



Probably the easiest way is to stuff the XML into a DOM Object and run and XSLT on it to produce your desired output.

syber

2:11 am on Nov 14, 2004 (gmt 0)

10+ Year Member



This is the ASP code I use for displaying RSS feeds:

sourceFile = "http://www.example.com/rss.xml"
styleFile = Server.MapPath("newsfeed.xsl")

Set xmlhttp = Server.CreateObject("MSXML2.SERVERXMLHTTP")
xmlhttp.Open "GET", sourceFile, false
xmlhttp.Send

set source = Server.CreateObject("MSXML2.DOMDocument")
source.async = false
source.loadxml(xmlhttp.ResponseText)

set style = Server.CreateObject("MSXML2.DOMDocument")
style.async = false
style.load(styleFile)

Response.Write source.transformNode(style)


Art