For those who
are somewhat new to working with XML, LINQ to XML provides a simple but powerful query experience
(instead of their having to learn a more complex XML query language). More-advanced developers can
use LINQ to XML to enhance their XML programming by writing less code that is just as powerful,
easier to read, and much more expressive. The key is that LINQ to XML is not targeted to a specific level
of developer??”it can be used by any developer who needs to work with XML.
LINQ to XML is provided via the System.Xml.Linq namespace, which contains all of the classes
necessary to work with XML. Add a reference to System.Xml.Linq.dll to your project, and then place
a using directive in the declarations section of your code, as follows:
using System.Xml.Linq;
Adding this directive enables the use of LINQ to XML types in the namespace. If you plan to work with
relational data, you need to use System.Data.Linq as well.
LINQ to XML Programming Fundamentals
As Chapter 2, ??????A Look at Visual Studio 2008,??™??™ explained, LINQ (and therefore LINQ to XML) utilizes
generic classes quite heavily.
Pages:
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182