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
Post a Comment