Using Xpath With Default Namespace in C#

Posted by macleojw on Stack Overflow See other posts from Stack Overflow or by macleojw
Published on 2009-02-25T12:34:57Z Indexed on 2010/05/26 8:21 UTC
Read the original article Hit count: 339

Filed under:
|
|
|
|

I've got an XML document with a default namespace. I'm using a XPathNavigator to select a set of nodes using Xpath as follows:

XmlElement myXML = ...;  
XPathNavigator navigator = myXML.CreateNavigator();
XPathNodeIterator result = navigator.Select("/outerelement/innerelement");

I am not getting any results back: I'm assuming this is because I am not specifying the namespace. How can I include the namespace in my select?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml