XML is an increasingly popular way to encode documents, data, and electronic messages. There are a number of ways to programmatically
create, modify, and search XML files. Since its inception, the .NET Framework’s System.Xml
namespace has included classes for programmatically working with XML documents. For instance, the XmlReader
and XmlWriter classes offer developers a means to read from or write to
XML files in a fast, forward-only manner, while the XmlDocument class
allows developers to work with an XML document as an in-memory tree representation.
LINQ to XML is a new set of XML-related classes in the .NET Framework (found in the
System.Xml.Linq namespace), which enable developers to work with XML documents using
LINQ’s features, syntax, and semantics. Compared to .NET’s existing XML APIs, LINQ to XML is a simpler, easier to use API. For a given task, LINQ to XML code is typically shorter
and more readable than code that uses the XmlDocument or XmlReader/XmlWriter classes. And perhaps most importantly, LINQ to XML allows
you to leverage your existing knowledge and familiarity with LINQ’s standard query operators and query syntax.
This article is the first in a series of articles that examines LINQ to XML. This installment introduces the LINQ to XML API, examines some of the more pertinent classes
in the System.Xml.Linq namespace, and shows how to perform a number of common XML tasks using the API. Read on to learn more!
Read More >
RSS feed for comments on this post · TrackBack URI
Leave a reply