將資料輸出成RSS

<%@Language="VBScript" Codepage="65001"%>
<%
Set XMLDOMRss=Server.CreateObject("Microsoft.FreeThreadedXMLDOM")
XMLDOMRss.appendChild(XMLDOMRss.createElement("rss"))
XMLDOMRss.documentElement.attributes.setNamedItem(XMLDOMRss.createNode(2,"version","")).text="2.0"
Set node=XMLDOMRss.documentElement.appendChild(XMLDOMRss.createNode(1,"channel",""))
node.appendChild(XMLDOMRss.createNode(1,"title","")).text="xxx"
node.appendChild(XMLDOMRss.createNode(1,"link","")).text="http://網址"
node.appendChild(XMLDOMRss.createNode(1,"language","")).text="zh-tw"
node.appendChild(XMLDOMRss.createNode(1,"description","")).text=""
node.appendChild(XMLDOMRss.createNode(1,"copyright","")).text=""
node.appendChild(XMLDOMRss.createNode(1,"generator","")).text=""
node.appendChild(XMLDOMRss.createNode(1,"webMaster","")).text=""

sSQLCmd="select xx from where xx order by Id desc"

Set rs = Get_rs(conn,sSQLCmd)
while not rs.eof

Set Cnode=node.appendChild(XMLDOMRss.createNode(1,"item",""))

Cnode.appendChild(XMLDOMRss.createNode(1,"title","")).text= rs("Title")
Cnode.appendChild(XMLDOMRss.createNode(1,"url","")).text=""
Cnode.appendChild(XMLDOMRss.createNode(1,"link","")).text= http://www.xoxo.idv.tw/datadetail.asp?id="&rs("Id")

Cnode.appendChild(XMLDOMRss.createNode(1,"description","")).text=Memo
rs.Movenext
wend

Response.Clear
Response.CharSet="UTF-8"
Response.ContentType="text/xml"
Response.Write ""&vbNewLine
Response.Write XMLDOMRss.xml
Set XMLDOMRss=Nothing


%>
 

Other