Category: LINQ to Object
LINQ-to-XML Examples...
In the previous post, I did some experimentation with XPath Expressions on a very simple XML file. I provided examples of XPath expressions and how to execute these expressions using XmlDocument and XPathDocument. Although powerful, XPath Expressions can come off as a bit cryptic. As your query becomes more complicated, so does the expression. XPath Expressions can get as ugly as Regular Expressions. Fortunately, starting with the .NET Framework 3.0 Microsoft introduced the Language Integrated Query (LINQ). This set of extensions to the .NET Framework provides unified methods for querying almost any type of .NET object.
Let’s take the XPath queries from the previous post and do some LINQ-to-XML instead…