title: How to Select XML Nodes with XML Namespaces from an XmlDocument?
body: <p>my code attempts to grab data from the RSS feed of a website. It grabs the nodes fine, but when attempting to grab the data from a node with a colon, it crashes and gives the error "Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function." The code is shown below:</p>
  
  <pre><code>WebRequest request = WebRequest.Create("http://buypoe.com/external.php?type=RSS2&amp;lastpost=true");
  WebResponse response = request.GetResponse();
  
  StringBuilder sb = new StringBuilder("");
  System.IO.StreamReader rssStream = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("utf-8"));
  
  XmlDocument rssDoc = new XmlDocument();
  rssDoc.Load(rssStream);
  
  XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item");
  
  for (int i = 0; i &lt; 5; i++)
  {
     XmlNode rssDetail;
     rssDetail = rssItems.Item(i).SelectSingleNode("dc:creator");
  
     if (rssDetail != null)
     {
        user = rssDetail.InnerText;
     }
     else
     {
        user = "";
     }
  }
  </code></pre>
  
  <p>I understand that I need to define the namespace, but am unsure how to do this. Help would be appreciated.</p>