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 -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -