下载XML文件错误,LINQ [英] Downloading XML file error, LINQ
问题描述
我目前正在开发Silverlight WP7应用程序,该应用程序从互联网上下载RSS/XML提要,并且每次在包含"georss:point"字段的情况下运行它时,都会收到以下错误消息:
异常{"The":字符,十六进制值0x3A,不能包含在名称中.} System.Exception {System.Xml.XmlException}
是否有人对如何下载其中带有:"的XML字段有任何想法?
这是我的代码,当我将"georss:point"行作为注释并在XAML中删除该字段的数据绑定时,它可以正常工作.
I am currently developing a Silverlight WP7 application that downloads an RSS/XML feed from the internet and everytime I run it with the "georss:point" field included I get the following error message:
Exception {"The '':'' character, hexadecimal value 0x3A, cannot be included in a name."} System.Exception {System.Xml.XmlException}
Does anyone have any ideas on how you can download XML field that have the ":" in them?
Here is my code which works fine when I put the "georss:point" line as a comment and remove the databinding for that field in the XAML.
XElement xmlScan = XElement.Parse(e.Result);
listBox1.ItemsSource = from channel in xmlScan.Descendants("item")
select new ScanItem
{
title = channel.Element("title").Value,
description = strip2(strip(channel.Element("description").Value)),
georss = channel.Element("gesorss:point").Value,
};
推荐答案
查看 ^ ]条目.
这篇关于下载XML文件错误,LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!