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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -