Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XmlNode oldCd;

C#
XmlElement root = doc.DocumentElement;
System.Xml.XmlElement conditie =(System.Xml.XmlElement)root.ChildNodes[0].ChildNodes[0];
string dbPath = conditie.ChildNodes[0].InnerText;
oldCd = root.SelectSingleNode("/Information|Datas|[DataBasePath ='" + dbPath + "']");


Error: Expression must evaluate to a node-set. 

how to solve?
Posted
Updated 27-Sep-11 23:03pm
v2
Comments
Sergey Alexandrovich Kryukov 28-Sep-11 18:56pm    
Bad issue report. Compile-time (which I don't see) or run-time (exception)? In what line? (Certainly in the last one; this is just a bad xPath expression.) Always provide complete exception information.
--SA
RoshInd 1-Oct-11 2:17am    
oldCd = root.SelectSingleNode("//Information/Datas[DataBasePath ='" + dbPath + "']");
Wael Al Wirr 19-Dec-11 4:32am    
Please share your xml so i can see the target node

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900