0

我正在尝试处理一个 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
4

1 回答 1

0

该页面不是 XML 源;你应该使用http://www.google.com/reader/public/atom/user/02179771748407903760/state/com.google/broadcast

于 2009-12-23T18:53:53.670 回答