The problem is that the XML file defines a default namespace, and you are
not adding the namespace when you perform the query. You do this with a
NameSpaceManager:
XmlDocument doc = new XmlDocument();
doc.Load(isDBConfig);
XmlNamespaceManager nsManager = new
XmlNamespaceManager(doc.NameTable);
nsManager.AddNamespace("d", "http://tempuri.org/dsConfig.xsd");
XmlNode Appconfig = doc.SelectSingleNode("//d:logging_option",
nsManager);
//Now it should find your node instead of returning null
> Hi, I am trying to retrieve a value from a node in an XML document and
> cannot.. .any ideas?
[quoted text clipped - 42 lines]
>
> I cannot figure out what i'm doing wrong.
Soulless - 23 Oct 2007 20:30 GMT
On Oct 23, 12:18 pm, "Alberto Poblacion" <earthling-
quitaestoparacontes...@poblacion.org> wrote:
> The problem is that the XML file defines a default namespace, and you are
> not adding the namespace when you perform the query. You do this with a
[quoted text clipped - 57 lines]
>
> - Show quoted text -
Thank you! worked like a charm :)