Home > ASP Development > RSS Feed Issue

RSS Feed Issue



Hi, i am trying to create my own rss feed.



I have got the xml to display in the browser. However, isn't an rss feed supposed to show the links and details in a list so when the user clicks on the link, it's supposed to go to that site?



Can someone help me out doing this and also explain, when i should output it and when i should display it.




Code:


<%
response.ContentType = "text/xml"
%>
<!--#include file="..\Connections\Open.asp"-->
<%


dim objrs,strSQL

strSQL = "SELECT * FROM [RSStest]"
set objrs = server.createobject("ADODB.recordset")
objrs.open strSQL, objconn,1, 3

x = 0
For x = 1 to 10
if objrs.eof or objrs.bof then
exit for
else
response.write("<?xml version=""1.0"" encoding=""ISO-8859-1""?>")
response.write("<rss version=""2.0"">")
response.write("<news>")
while (not objrs.EOF)
Response.Write "<item>"
Response.Write "<title>" & objrs("Title") & "</title>"
Response.Write "<link>" & objrs("Link") & "</link>"
Response.Write "<description>" & objrs("description") & "</description>"
Response.Write "<pubDate>" & objrs("date") & "</pubDate>"
Response.Write "</item>"
objrs.MoveNext()
wend
response.write("</news>")
response.write("</rss>")
end if
Next
objrs.close()

%><!--#include file="..\Connections\Close.asp"-->



    
Guest


what exactly is the problem?

I'm not familiar with the format of RSS but if you get error

maybe I can help you solve it.

Was this answer helpful ? Yes No   
Guest


Hi, i don't get an error.



The above code works fine. The problem is; all the other rsss feed pages i have seen display the information in a list, showing the link and description of data, so the user can read it.



My code does not do that, so i would like a decent link, if you have one. All the links i have only display rss feeds from websites.



I would like to display my own rss feed from my computer.

Was this answer helpful ? Yes No   
Guest


so what your code do? can you please post example of xml you get? maybe

it's only matter of changing the doctype or giving format.

for example devshed use this to style their RSS feed:


Code:



<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- Copyright (C) 2001-2006 - Developer Shed, Inc. --><!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">



Was this answer helpful ? Yes No   
Guest


Hi, this is my output. The problem is why is it only displaying the xml only.



Shouldn't rss feeds show the links so the user can click on them?



Oh yes, forgot the mention that the xml bit, is in blue as though it is not being used.




Code:


<?xml version="1.0" encoding="ISO-8859-1" ?>  
- <rss version="2.0">
- <news>
- <item>
<title>test</title>
<link>http://www.nmbs.co.uk</link>
<description>test</description>
<pubDate>01/01/2003</pubDate>
</item>
</news>
</rss>



Was this answer helpful ? Yes No   
Guest


it's displaying the xml only because you didn't say otherwise.

click on the RSS button here on this page for example.

click View Source, copy&paste the whole thing into new local file.

now remove the line of code I posted above and.. you'll see only the raw xml.

the xsl and css files define how the xml is going to look like... that's what

you should explore and learn.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved