我正在做一个rss订阅阅读器,看起来工作很棒。我唯一不能正常工作的事情就是阅读提要中的图像。
<itunes:image href="http://www.itunes.com/image.jpg"/>有人能帮上忙吗?
这是我代码的一部分。
For Each objItem in objItems
On Error Resume Next
TheTitle = objItem.selectSingleNode("title").Text
TheLink = objItem.selectSingleNode("image").Text
Theimg = objItem.SelectSingleNode("itunes").Attributes(":image").InnerText
Response.Write "<div class='article'>" &_
"<a href=" & TheLink & ">" & _
"<span>" & Theimg & TheTitle & "</span>" & _
"</a>" & _
"</div>"
Next发布于 2015-05-03 23:57:28
你的图片地址需要放在图片标签里
Response.Write "<div class=""article"">" &_
"<a href=""" & TheLink & """>" & _
"<img src=""" & Theimg & """ alt=""" & TheTitle & """ />" & _
"</a>" & _
"</div>"如果你想知道为什么所有的双引号,请看这个问题
Adding quotes to a string in VBScript
顺便说一句,如果您了解XSL,那么我发现在Classic ASP中处理RSS提要的最好方法是进行服务器端XSLT转换。ASP如下所示
set xml = Server.CreateObject("Msxml2.DomDocument.6.0")
xml.setProperty "ServerHTTPRequest", true
xml.async = false
xml.validateOnParse = false
xml.load("http://your-rss-feed")
set xsl = Server.CreateObject("Msxml2.DomDocument.6.0")
xsl.load(Server.Mappath("yourxslfile.xsl"))
Response.Write(xml.transformNode(xsl))
set xsl = nothing
set xml = nothinghttps://stackoverflow.com/questions/30011097
复制相似问题