XML Tree Viewer (VB)

Description: The XMLTree Viewer application is a Visual Basic application that reads an XML file and displays the contents in a TreeView control.

ITPro Today

November 14, 2001

1 Min Read
ITPro Today logo

Description: The XMLTree Viewer application is a Visual Basic application that reads an XML file and displays the contents in a TreeView control.

More Details

The project does not use any classes or sophisticated design. It simply prompts the user for an XML file to parse and display. The goal of this application is to demonstrate how to work with the XML DOM and to get an understanding of the hierarchy of an XML document.

Once a file is referenced the application uses an XML DOM reference, declared using the WithEvents keyword, to trap the ondataavailable and onreadystatechange events. The ondataavailable event is used to display a count of the nodes. The onreadystatechange event is used to check for errors and to call the DisplayDomNode routine. The DisplayDomNode routine does all the real work and loads the XML data into the TreeView.

Browser/Platform Compatibility

This sample requires Internet Explorer 5.0 and Windows 98, Windows NT 4.0, or Windows 2000.

Usage

Simply run the application click on the ellipses to locate any XML file. Then click the Load button. The XML file should be displayed in the TreeView control.

Complete Article

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like