【问题标题】:unexpected token in rss feedRSS 提要中的意外标记
【发布时间】:2009-12-23 18:46:22
【问题描述】:

我正在尝试处理一个 rss url,但给了我一个错误 “'--' 是一个意外的标记。预期的标记是 '>'。第 81 行,位置 5。”

当我查看源代码时,它在 xml 节点的中间有一个值“Knowledge@Wharton -- Innovation and Entrepreneurship”。

我如何处理这个 url 并忽略那个错误。

Public Shared Function HasRssItems() As Boolean
    Dim myRequest As WebRequest
    Dim myResponse As WebResponse
    Try
        myRequest = System.Net.WebRequest.Create("http://www.google.com/reader/shared/i.am.muralibala")
        myRequest.Timeout = 5000
        myResponse = myRequest.GetResponse()

        Dim rssStream As Stream = myResponse.GetResponseStream()
        Dim rssDoc As New XmlDocument()
        rssDoc.Load(rssStream)

        Return rssDoc.SelectNodes("rss/channel/item").Count > 0
    Catch ex As Exception
        Return False
    Finally
        myResponse.Close()
    End Try

End Function

【问题讨论】:

    标签: xml rss token feed


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多