LINQ to XML solves this
problem by automatically resolving prefixes to their XML namespace.
The following three sections detail the classes that you will typically use most when working with
XML: XElement, XAttribute, and XDocument. If you master those classes, LINQ to XML will become
second nature.
XElement Class
The XElement class represents an XML element. It is derived from the XContainer class, which derives
from the XNode class. An element is a node, so many times you will see these terms used interchangeably.
The XElement class is one of the most important and fundamental classes of LINQ to XML because it
contains all of the functionality necessary to create and manipulate XML elements. Via this class you can
create elements, add and modify attributes of elements, and even manipulate the content of an element
such as adding, deleting, or modifying child elements.
There are several ways to create XML documents with LINQ to XML, depending on the source of your
XML or if you are creating an XML document from scratch. The simplest and most common way to create
XML is to use the good ol??™ XElement class of LINQ to XML as follows:
XDocument riders = new XDocument
(new XDeclaration("1.
Pages:
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186