您好,我在从 xml 文件中包含的 url 获取图片时遇到问题:
<item>
<title>Music</title>
<photo>http://www.jawharafm.net/jfmfiles/photos/hamdi.jpg</photo>
</item>
这是我的代码c#:
XElement xmlItems = XElement.Parse(e.Result);
listBox1.ItemsSource = from channel in xmlItems.Descendants("item")
let tit = channel.Element("title")
let pho = channel.Element("photo")
select new items
{
title = tit == null ? null : tit.Value,
photo = pho == null ? null : pho.Value,
};
我也有一个小问题,在解析文档后忽略样式应答器显示文本,如下所示:
<description>
<![CDATA[<style>img { max-width: 310px; }</style><div>un concours mondial, appelé "BlueHat"</span>, pour récompenser le ou la passionné d'informatique capable <span style="color: #3366ff;">10.000 dollars</span>.</div>
<div /><span style="color: #ffffff;" />....]]>
</description>
谢谢