1
XML元素後裔從twitter atom feed我試圖用linqToXml得到一些飼料數據:獲取LINQ到具有特定屬性值
atomFeed = XDocument.Load(feedUrl);
var tweets = (from entry in atomFeed.Descendants("entry")
select new
{
Date = entry.Element("published").Value,
Title = entry.Element("title").Value,
Url = entry.Element("link").Value // with type="image/jpeg"
}
);
由於有兩個連接類型(一個屬性類型=「文/ HTML「和一個類型=」image/jpeg「它不起作用我只需要鏈接到jpeg,但不知道如何從xml中只提取該鏈接
很好,謝謝!對於其他使用twitter的人來說:使用屬性rel =「image」,因爲類型也可以是png等。 – Eric 2011-04-01 14:57:08