Hi All,
I have this weird problem. I have an xml document and tried to do an XPath
query to it. If I use the SelectSingleNode method it throws an exception but
it works with SelectNodes method. Is this a known problem with XPath and
SelectSingleNode?
Code snippet:
<snip>
XmlDocument xml= new XmlDocument();
xml.LoadXml(xmlString);
XmlNamespaceManager namespaceManager =
new XmlNamespaceManager(xml.NameTable);
namespaceManager.AddNamespace("defns", defns);
// return xml.DocumentElement.SelectSingleNode(xpath, namespaceManager);
<-- does not work
return xml.DocumentElement.SelectNodes(xpath, namespaceManager); // WORKS!
</snip>
so ... this is odd, does anyone has any explanation?
thanks,
/m