c# - XPathSelectElement always return null -


string xml = @"<vehicle>   <cars>     <car>tet</car>    </cars> </vehicle>"; xelement x = xelement.parse(xml); var node = x.xpathselectelement("//vehicle/cars"); 

why node null?

xpath should

var node = x.xpathselectelement("cars"); 

output:

<cars>   <car>tet</car> </cars> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -