O'Reilly logo

Programming Microsoft® LINQ in Microsoft .NET Framework 4 by Paolo Pialorsi and Marco Russo

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

Chapter 13. LINQ to XML: Querying Nodes

Starting with the XML Infoset you learned about in Chapter 12, you can think of every node set as a sequence of nodes that you can query using Microsoft Language Integrated Query (LINQ)—just like any sequence of type IEnumerable<T>. From that perspective, you can make the case that every concept you have already seen applied to other sequences of items in the LINQ query fields (such as LINQ to Objects, LINQ to SQL, and so forth) can also be used with XML nodes. In fact, LINQ to XML exposes every collection of nodes as an IEnumerable<T> instance.

Querying XML

You can use the standard query extension methods described in Chapter 3, to query XML nodes, but there are also a group of custom extension methods, declared ...

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