;/generator>" & sCrLf
sRssEnd = "</channel></rss>"
Response.CharSet="gb2312" ’数据集
Response.ContentType="text/xml" ’数据流格式定义
’输出:
Response.write sXmlClear
Response.write sRssHead
sSQL="select top 15 * from news order by sortid desc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sSQL, s_Conn, 1, 1
if not (rs.eof and rs.bof) then
do while not rs.eof
response.write "<item>" & sCrLf
response.write "<title> " & rs("f_topic") & " </title>" & sCrLf
response.write "<link> " & "http://www.sgxcn.com/news/show_a_new.asp?autoid="; &
rs("f_i_autoid") & " </link>" & sCrLf
response.write "<author> " & rs("f_author") & " </author>" & sCrLf
response.write "<pubDate> " & rs("f_datetime") & " </pubDate>" & sCrLf
response.write "</item>" & sCrLf & sCrLf
rs.movenext
loop
end if
rs.close
set rs=nothing
Response.write sRssEnd
%>
IE 中的调用格式是:<a href="http://www.sgxcn.com/news/RssFeednews.asp";>技术新闻
RSS</a>。如果用一些客户端软件订阅该 RSS,订阅的 Url 就是http://www.sgxcn.com/news/RssFeednews.asp。