[XML] 关于ASP生成RSS核心代码

发布时间:2007年02月12日      浏览次数:984 次
RSS怎么制作的,其实RSS就是XML,我们只要按据RSS的规范语法搞清楚,不懂是ASP还是PHP都可以实现.我就将这个博客的生成RSS的核心代码发给大家.
Dim sSQL, rs, sCrLf, sXmlClear, RRSTEXT, sRssEnd
sCrLf = chr(13) & chr(10) '回车+换行,后面会一直用,因为xml中文本显示换行.
sXmlClear = "" & sCrLf
RRSTEXT = "" & sCrLf
RRSTEXT = RRSTEXT & "" & sCrLf
RRSTEXT = RRSTEXT & "" & sCrLf
RRSTEXT = RRSTEXT & "未经许可,请不要转载,谢谢" & sCrLf
RRSTEXT = RRSTEXT & "http://www.laohe.com/" & sCrLf
RRSTEXT = RRSTEXT & "zh-cn" & sCrLf
RRSTEXT = RRSTEXT & "www.laohe.com" & sCrLf
RRSTEXT = RRSTEXT & "讲述老河自己的故事,末经许可请勿转载,官方网站www.laohe.com" & sCrLf
sRssEnd = ""
Response.CharSet="gb2312" '数据集
Response.ContentType="text/xml" '数据流格式定义
'输出:
Response.write sXmlClear
Response.write RRSTEXT
If Not R1.EOF Or Not R1.BOF Then
While ((Repeat1__numRows <> 0) AND (NOT R1.EOF))
response.write "" & sCrLf
response.write "" & sCrLf
response.write "" & "http://www.laohe.com/showblog.asp?id="&(R1.Fields.Item("ID").Value) & "" & sCrLf
response.write ""& sCrLf
response.write "" '这里是显示内容的.我设置显示所有.
response.write ""& sCrLf
response.write "老河"& sCrLf
response.write " " &(R1.Fields.Item("Cdatetime").Value) & "" & sCrLf
response.write "" & sCrLf & sCrLf
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
R1.MoveNext()
Wend
文章来源:http://www.divcss.cn/read.php/21.htm
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!