Friday, April 24, 2009

Find the Node having none attribute using C#

Today, I need to search node having none attributes from xml file.

For this, We need to use below XPath query in SelectNodes of the XMLDocument object.

XMLNodeList list = doc.SelectNodes(@"parenttag/child1/child11[not(@*)]");

returns the child11 having none attributes.

No comments:

Post a Comment