O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Nodes

The Nodes operator can be called on a sequence of elements or documents and returns a sequence of nodes containing each source element's or document's child nodes.

This operator is different than the DescendantNodes operator in that the Nodes operator only returns the immediate child elements of each element in the source sequence of elements, whereas the DescendantNodes operator recursively returns all child nodes until the end of each tree is reached.

Prototypes

The Nodes operator has one prototype.

Example. The Only Nodes Prototype
public static IEnumerable<XNode> Nodes<T> (
  this IEnumerable<T> source
) where T : XContainer

This version is called on a sequence of elements or documents and returns a sequence of nodes containing each ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required