showRssbyXsl

‘*************************************************
‘过程名:showRssbyXsl
‘作 用:显示RSS
‘参 数:通过request获取两个参数ID–Rss编号,feedurl–RSS路径
‘返回值:无
‘*************************************************
sub showRssbyXsl(xslText)
dim RssId,htc
RssId=trim(Request(“ID”))
htc=updateRSSHtc(RssId,”1″)

Dim feedurl
feedurl=Trim(Request(“feedurl”))
If feedurl=”” Then
response.Write(“<form method=post action=””””>”)
response.Write(“RSS地址:<input type=””text”” name=””feedurl”” size=””30″”><input type=””submit”” value=””我要阅读””></form>”)

else
Set http=Server.CreateObject(“Microsoft.XMLHTTP”)
http.Open “GET”,feedurl,false
http.send

Set xml=Server.CreateObject(“Microsoft.XMLDOM”)
xml.Async=False
xml.ValidateOnParse=False
xml.Load(http.ResponseXML)

Set xsl=Server.CreateObject(“Microsoft.XMLDOM”)
xsl.Async=False
xsl.ValidateOnParse=False
xsl.LoadXml(xslText)
dim strTemp
strTemp=xml.transformNode(xsl)
strTemp=replace(strTemp,”&lt;”,”<“)
strTemp=replace(strTemp,”&gt;”,”>”)
strTemp=replace(strTemp,”&amp;”,”&”)

strTemp=replace(strTemp,”[$m_htc$]”,htc)’instr(strTemp,”$m_htc”)
response.Charset=”utf-8″
response.Write strTemp

Set http=Nothing
Set xml=Nothing
End If
end sub

« »