O'Reilly logo

Programming Visual Basic 2008 by Tim Patrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using XML in .NET: The Old Way

Visual Basic includes two primary methods for working with XML content: the old way and the new way. The old way uses classes from the System.Xml namespace, and provides traditional object-based access to XML tags, attributes, and data. The new way, introduced in the 2008 release, uses classes in the System.Xml.Linq namespace, and provides access to XML content directly within the syntax of Visual Basic source code. I'll discuss both methods in this chapter, starting with the old way.

Since XML is no fun to manage as a big chunk of text, .NET includes several classes that manage XML data. All of these tools appear in the System.Xml namespace and its subordinate namespaces:

System.Xml

The main collection of old-way XML-related classes.

System.Xml.Linq

Classes that integrate XML with LINQ technologies. This is the new way that I'm going to talk about later.

System.Xml.Schema

Classes that create and use XSD schemas.

System.Xml.Serialization

Classes that read and write XML documents via a standard .NET stream.

System.Xml.XPath

Classes that implement the XPath technology used to search XML documents.

System.Xml.Xsl

Classes that enable XSL Transformations.

The features included in each class tie pretty closely to the structure of XML and related technologies such as XSD and XSLT.

The Basic XML Classes, Basically

The System.Xml namespace includes the most basic classes you will use to manage XML data. An XmlDocument object is the in-memory view of your actual XML document: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required