這是我的代碼:如何反序列化RSS?
var objectText = XmlReader.Create(requestedURL);
XmlSerializer mySerializer = new XmlSerializer(typeof(InstagramItems));
var instagramItems = (InstagramItems)mySerializer.Deserialize(objectText);
,但似乎不能與RSS的工作(這是 「XML或多或少」):
Server Error - <rss xmlns=''> was not expected.
我該怎麼辦呢?我相信有沒有使用第三部分插件.NET庫。在RSS的
部分:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>Photos tagged as "example" on Instagram</title>
<link>http://instagram.com</link>
<description>Photos tagged as "example" on Instagram</description>
<atom:link href="http://instagram.com/tags/example/feed/recent.rss" rel="self" />
</channel>
請您發表一塊XML的前兩者的Instagram和RSS類型的DataContractSerializer的文件? –