c# - XElement: a collection of all the leaves? -


How to obtain a collection of all the leaves of a XElement tree, regard the hierarchy? Thanks

What is the way you are after?

This all descendants - to get only the leaves, you get a where section:

  element.Descendants () With LINQ can use the object. (Desc = & gt ;! Des.Elements (.) Anyone ());  

(Note that this is still the only element, not other nodes like text node. Hope is ok.)


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -