Loading the XML Document

Dealing with XML starts with the System.Xml.XmlDocument class. This class supports loading, manipulating, and saving XML data.

NOTE

In the last chapter you learned about the System.Xml.XmlDataDocument in regards to synchronizing data between XML and a DataSet. The XmlDataDocument class is a subclass of XmlDocument. Therefore, everything discussed in this chapter and the next chapter also applies to XmlDataDocument.

Loading XML in your code is performed by calling the Load or LoadXml methods on an XmlDocument object. The Load method reads data using a filename or an XmlReader object. The LoadXml method is used to load an XmlDocument by directly passing in a string that contains XML.

Here is an example XML document, named ...

Get Visual Basic® .NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.