We need to see xml; @Lee gives the correct approach here, so something like:
var el = rootElRecDocXml.SelectSingleNode(
"/ArrayOfRecentFiles/RecentFile[text()='"+mFilePath+"']");
(taking into account your answer / answer)
However! There are many mistakes:
- the request will be case sensitive
- (
<foo>abc</foo> <foo> abc[newline]</foo> .. - ) - xml ,
.SelectSingleNode("/alias:ArrayOfRecentFiles[text()='"+mFilePath+"']", nsmgr);, nsmgr -
, :
XmlDocument rootElRecDocXml = new XmlDocument();
rootElRecDocXml.LoadXml(@"<ArrayOfRecentFiles> <RecentFile>C:\asd\1\Examples\8389.atc</RecentFile> <RecentFile>C:\asd\1\Examples\8385.atc</RecentFile> </ArrayOfRecentFiles>");
string mFilePath = @"C:\asd\1\Examples\8385.atc";
var el = rootElRecDocXml.SelectSingleNode(
"/ArrayOfRecentFiles/RecentFile[text()='" + mFilePath + "']");
el null SelectSingleNode. node.