【问题标题】:Podcast rss feed reading itunes image in classic asp播客 rss 提要在经典 asp 中读取 iTunes 图像
【发布时间】:2015-05-03 06:53:48
【问题描述】:

我正在开发一个 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

【问题讨论】:

    标签: asp-classic rss podcast


    【解决方案1】:

    您的图片地址需要放在图片标签内

    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 = nothing
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-12
      • 2010-10-01
      • 2014-01-25
      • 2014-10-23
      相关资源
      最近更新 更多