我怎么能够用XDocument把这一形象混为一谈?
<enclosure length="1234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/3223wee.jpg" />
我的人喜欢这样看。
<item>
<title>aaa</title>
<desc>aaa</desc>
<enclosure length="3234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/1223wee.jpg" />
</item>
<item>
<title>aaa</title>
<desc>aaa</desc>
<enclosure length="1234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/3223wee.jpg" />
</item>
<>strong>edited:
工作、正确守则:
XDocument xdoc = XDocument.Parse(e.Result);
var data = from query in xdoc.Descendants("item")
select new Cikk
{
Title = (query.Element("title") == null) ? "" : (string)query.Element("title").Value.ToString().Replace("<![CDATA[", "").Replace("]]>", ""),
Description = (query.Element("description").Value.Equals("")) ? "" : (string)query.Element("description").Value.ToString().Replace("<![CDATA[", "").Replace("]]>", "").Substring(0, 20) + "...",
Source = (query.Element("enclosure") == null) ? "" : (string)query.Element("enclosure").Attribute("url").Value
};