次のエラーが表示されます。
' ' (16 進値 0x1F) は無効な文字です
これが私の機能です。初めて「reader.MoveToContent()」にヒットすると、このエラーが発生します。誰かが私を正しい方向に向けることができますか?
Public Function GetSyndicationFeedData(ByVal urlFeedLocation As String) As SyndicationFeed
Dim settings As New XmlReaderSettings() With { _
.IgnoreWhitespace = True, _
.CheckCharacters = True, _
.CloseInput = True, _
.IgnoreComments = True, _
.IgnoreProcessingInstructions = True _
}
If [String].IsNullOrEmpty(urlFeedLocation) Then
Return Nothing
End If
Using reader As XmlReader = XmlReader.Create(urlFeedLocation, settings)
If reader.ReadState = ReadState.Initial Then
reader.MoveToContent()
End If
' Now try reading...
Dim atom As New Atom10FeedFormatter()
Dim rss20 As New Rss20FeedFormatter()
' Atom
If atom.CanRead(reader) Then
atom.ReadFrom(reader)
Return atom.Feed
'Rss 2.0
ElseIf rss20.CanRead(reader) Then
rss20.ReadFrom(reader)
Return rss20.Feed
Else
Return Nothing
End If
End Using
End Function