Find node in XML with NameSpace


Beginers C# parse XML manually :)
Using XPath is more efficiently, like this:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(data[0].RowID);

XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
nsmgr.AddNamespace("ns1", xmlDoc.DocumentElement.NamespaceURI);

XmlNode nodeEmail = xmlDoc.SelectSingleNode("/ns1:feed/ns1:author/ns1:email", nsmgr);
XmlNode nodeUserID = xmlDoc.SelectSingleNode("/ns1:feed/ns1:entry/ns1:id", nsmgr);
XmlNode nodeUserName = xmlDoc.SelectSingleNode("/ns1:feed/ns1:entry/ns1:title", nsmgr);

For more interest, use XPathVisualizer

http://stackoverflow.com/questions/585812/using-xpath-with-default-namespace-in-c
http://mydotnet.wordpress.com/2008/05/29/worlds-smallest-xml-xpath-tutorial/