Load an XML File into a DOM Object (Visual Basic)

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Developer's Guide

Load an XML File into a DOM Object (Visual Basic)

To process XML data serialized as an XML file on the file system, you use the load method on an XML DOM object, supplying the file path as the input.

This tutorial uses or creates the following files:

File Description
Source: LoadXMLFile.frm Visual Basic source code.
Resource: test.xml External XML file to be loaded into DOM.
Output Output from the application.

To create the LoadXMLFile Visual Basic Project

  1. Create a Visual Basic project and set a reference to MSXML 5.0. For detailed instructions on how to do this, see Set Up My Visual Basic Project.
  2. Name the project LoadXMLFileProj.

Next, we'll add the source code for the LoadXMLFile project.