Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Mathulan for No Nodes Selected from Atom XML document using XPath?

Load XML from a string and lookup for any 'Errors/Error' nodes.

XmlDocument xmlDoc = new XmlDocument();xmlDoc.LoadXml(xmlResult);            XmlNamespaceManager nm = new XmlNamespaceManager(xmlDoc.NameTable);nm.AddNamespace("ns", "http://somedomain.com/namespace1/2"); //ns - any name, make sure it is same in the below lineXmlNodeList errors = xmlDoc.SelectNodes("/ns:*//ns:Errors/ns:Error", nm);       

-Mathulan


Viewing all articles
Browse latest Browse all 3

Trending Articles