Click here to Skip to main content
13,548,630 members
Click here to Skip to main content
Add your own
alternative version


29 bookmarked
Posted 23 Sep 2004

A Simple XML DOM Viewer/Navigator Using MC++

, 23 Sep 2004
Rate this:
Please Sign up or sign in to vote.
A simple GUI written in MC++ providing a DOM tree and XPath navigator for XML files

1. Introduction

This article presents a simple GUI written in VC++.NET 2003, its main features include showing a XML file in a treeView and navigating through the XML data by using XPath expressions. It was mainly developed for my own need: from time to time in my work, I often felt it would be very convenient if I had a simple GUI to "preview" the XML file the system generated or received before I take steps further to implement any processing to it - it could be used as a tool to simply confirm "everything is okay". I could have used IE to open the XML file, but IE does not provide any "intelligent" navigation through the data. Sometimes, the XML file can be very big, therefore, it would be very helpful to combine the "viewing" function together with the "navigating" function. So here it is, using this small tool, I can view the XML file and also carry out a search in the file.

I hope you find this small tool useful and if you are just beginning your development work with VC++.NET, you can then use this example to study how easy to process XML files using MC++. You can also download the source code and maybe you will be motivated enough to add some more features to it, and I am sure you will then find it very helpful to your daily work.

2. Using the code

You may directly download the executable or you may download the source code and build it in Visual Studio.NET 2003. When you try to open a XML file, a file selection dialog will show up. After you select the file, you can build the treeview of the XML file by clicking "build" button. You can then type XPath expressions to navigate in the tree.

XPath provides a more efficient way to locate data in a DOM tree. Just to make this small article complete, the following are some examples about how to use XPath expression (see the XML file in the screen shot):


this will match all the person nodes that are child nodes of personnel and personnel must be a root element node;


this will find all the person whose email is

I think the above examples are pretty much enough. If you provide a wrong expression, this small tool will show you some basic information, letting you know that something is wrong. Also, you can use the clear button to start over.

3. That is it!

Okay, hope you find it useful, also look forward to seeing new features added to it!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

liyang yu
Web Developer
United States United States
I love to tell jokes and today, I finally came up with my own joke. here it goes:

I decide to make my first son a medical doctor so later on when I am old and sick, I can get medical care any time I need and for free..., in fact, better to make my second son a medical doctor too so I can get a second opinion.

here is another version of this joke:

I decide to make my first son a medical doctor so later on when I am old and sick, I can get medical care any time I need and for free..., in fact, better to make my second son a medical doctor too so I can get a second opinion. well, perhaps my third son should be a lawyer - in case something is wrong with my medical care, I can sue the first two for free.

if you happen to visit this page and read these two jokes, tell me which one you like...

You may also be interested in...


Comments and Discussions

Generalxpath with date Pin
mathuros_paiboon15-Aug-05 23:15
membermathuros_paiboon15-Aug-05 23:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03-2016 | 2.8.180515.1 | Last Updated 23 Sep 2004
Article Copyright 2004 by liyang yu
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid