xpath of SelectNodes() does not work when tag contains xmlns

  • Thread starter Thread starter Jazper
  • Start date Start date
J

Jazper

hi

i have a problem querying a simple atom-feed by xpath using the
XmlDocument. i'm googleing for hours now and can't get a solution:

--- Code ---
XmlDocument doc = new XmlDocument();
doc.Load(XmlReader.Create(_feed.AbsoluteUri));
XmlNodeList list = doc.SelectNodes("feed");
// list.Count is always 0

--- XML-Document ---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>test</title>
</feed>

now as far as i take out the xmlns="http://www.w3.org/2005/Atom" the
xpath expression just works fine and SelectNodes() returns some
elements. however the atom feed contains this xmlns by default and i
have to deal with it.

what is my fault?
thanks for every hint
jazper manto
 
Back
Top