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