Other code:
private List ParseDilbertItemList(string text)
{
var xml = XDocument.Parse(text);
var items = xml.Descendants("item");
int size = items.Count();
var list = items.Select(x =>
new DilbertItem()
{
Title = x.Element("title").Value,
StripUrl = x.Element("enclosure").Attribute("url").Value
}).ToList();
return list;
}
You can change it to "https://api.flickr.com/services/feeds/photos_public.gne?format=rss2" for testing,thanks.
Other code: private List ParseDilbertItemList(string text)
{
var xml = XDocument.Parse(text);
var items = xml.Descendants("item");
int size = items.Count();
var list = items.Select(x =>
new DilbertItem()
{
Title = x.Element("title").Value,
StripUrl = x.Element("enclosure").Attribute("url").Value
}).ToList();
return list;
}
The run result: https://farm9.staticflickr.com/8715/16313994273_95b485260f_o.png
detail result: https://farm8.staticflickr.com/7622/16313996373_09edfba742_o.png