-1
이 이미지를 XDocument로 구문 분석하려면 어떻게해야합니까?Windows Phone 7에서이 xml 항목을 구문 분석합니다.
작업, 정확한 코드 :
<enclosure length="1234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/3223wee.jpg" />
내 RSS 편집이
<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>
같이
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
};