Prev | Current Page 16 | Next

Satheesh, N Kumar

"LINQ Quickly"


Integration with XML
LINQ to XML is a new concept that supports queries against XML data. This is
similar to the LINQ queries with relational data, but here the source of data is XML.
Using LINQ to XML, we can manipulate XML documents and elements, create or
save XML documents, and traverse through the XML tree.
Overview
[ 8 ]
When we use XML, we will be talking about elements and attributes. XML trees
are composed of only attributes and elements. If we look at W3C DOM, the XML
document object contains the whole XML tree in it. All elements and attributes are
created within the context of the XML document. For example, the .NET 2.0 way
of creating the XML element, Icecream using XML Document object model is
shown below:
XmlDocument xdoc = new XmlDocument();
XmlElement Icecream = xdoc.CreateElement("Icecream");
This is an unnecessary dependency that we have to follow.
.NET 3.0 avoids creating XML document objects and we can directly create elements
and attributes. For example, the following code is used for creating the Icecream
element using XElement.


Pages:
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
śmieszne dowcipy dieta light Connie Talbot zarządzanie nieruchomościami życzenia