Skip to Content
Professional Visual Basic 2012 and .NET 4.5 Programming
book

Professional Visual Basic 2012 and .NET 4.5 Programming

by Bill Sheldon, Billy Hollis, Rob Windsor, David McCarter, Gastón Hillar, Todd Herman
January 2013
Intermediate to advanced
912 pages
26h 58m
English
Wrox
Content preview from Professional Visual Basic 2012 and .NET 4.5 Programming

LINQ to XML

The previous sections of this chapter provided you with a general understanding of XML, how it is structured and how it can be accessed and manipulated using the .NET Framework. This section covers working with XML using newer features, specifically Language Integrated Query (LINQ), added in version 3.5 of the framework.

With the introduction of LINQ to the .NET Framework, the focus was on easy access to the data that you want to work with in your applications. One of the main data stores in the application space is XML, so it was really a no-brainer to create the LINQ to XML implementation. With the inclusion of System.Xml.Linq, you now have a series of capabilities that make the process of working with XML in your code much easier to achieve.

This chapter will only touch on how LINQ is used in relationship to XML. For the more basic description of LINQ and how it is used or works in a general sense, refer to chapter 9.

LINQ Helper XML Objects

Even if the LINQ querying capability were not around, the new objects available to work with the XML are so good that they can even stand on their own outside LINQ. Within the new System.Xml.Linq namespace, you will find a series of new LINQ to XML helper objects that make working with an XML document in memory that much easier. The following sections describe the new objects that are available within this new namespace.

Note
Many of the examples in this chapter use a file called Hamlet.xml, which you can find included in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Visual Basic 2012 Programmer's Reference

Visual Basic 2012 Programmer's Reference

Rod Stephens

Publisher Resources

ISBN: 9781118332139Purchase book