Error in ':' using C# and XML(XDocument)



I was trying something and ran into a problem using xml XDocument on C# and couldn't think of an effective way around it.



private void fillItems(string URL)
{
var webClient = new WebClient();
string result = webClient.DownloadString(URL);
XDocument reader = XDocument.Parse(result);

items.Clear();

foreach (var item in reader.Descendants("item"))
{
xmlItem temp = new xmlItem(item.Element("title").Value, (item.Element("torrent:magnetURI") != null ? item.Element("torrent:magnetURI").Value:"(no uri)"));
items.Add(temp);
}
updateList();
}


The "torrent:magnetURI" gives a problem stating that the ':' is not allowed (in runtime), I can't do away with the ':' in the full result string as some data gets lost...


Any suggestions are greatly appreciated the input url being used is "http://ift.tt/1vZTMlL"


No comments:

Post a Comment