Linq XML with multiple namespace will not



This is XML string testXML = @" true City Found OR Portland ";


This is C# trying to find City Portland. When the namespaces aren't there it works. My attempt below has first namespace but do I have to mention all 3? And how can that be done?



XNamespace ns1 = "http://ift.tt/ra1lAU";
XNamespace ns2 = "http://ift.tt/tphNwY";
XNamespace ns3 = "http://ift.tt/1BCfHlA";


XElement xelement = XElement.Parse(zexml());
var zelist = from tempo in xelement.Descendants(ns1 + "City")
select tempo;

var ztest = zelist.Count();

No comments:

Post a Comment