xmlParser  2.44
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
XMLParser library


This is a basic XML parser written in ANSI C++ for portability. It works by using recursion and a node tree for breaking down the elements of an XML document.

Frank Vanden Berghen

Copyright (c) 2002, Frank Vanden Berghen - All rights reserved.
Commercialized by Business-Insight
See the file AFPL-license.txt about the licensing terms

First Tutorial

You can follow a simple Tutorial to know the basics...

General usage: How to include the XMLParser library inside your project.

The library is composed of two files: xmlParser.cpp and xmlParser.h. These are the ONLY 2 files that you need when using the library inside your own projects.

All the functions of the library are documented inside the comments of the file xmlParser.h. These comments can be transformed in full-fledged HTML documentation using the DOXYGEN software: simply type: "doxygen doxy.cfg"

By default, the XMLParser library uses (char*) for string representation.To use the (wchar_t*) version of the library, you need to define the "_UNICODE" preprocessor definition variable (this is usually done inside your project definition file) (This is done automatically for you when using Visual Studio).

Advanced Tutorial and Many Examples of usage.

Some very small introductory examples are described inside the Tutorial file xmlParser.html

Some additional small examples are also inside the file xmlTest.cpp (for the "char*" version of the library) and inside the file xmlTestUnicode.cpp (for the "wchar_t*" version of the library). If you have a question, please review these additionnal examples before sending an e-mail to the author.

To build the examples:

In order to build the examples you need some additional files:

Debugging with the XMLParser library

Debugging under WINDOWS

Inside Visual C++, the "debug versions" of the memory allocation functions are very slow: Do not forget to compile in "release mode" to get maximum speed. When I had to debug a software that was using the XMLParser Library, it was usually a nightmare because the library was sooOOOoooo slow in debug mode (because of the slow memory allocations in Debug mode). To solve this problem, during all the debugging session, I am now using a very fast DLL version of the XMLParser Library (the DLL is compiled in release mode). Using the DLL version of the XMLParser Library allows me to have lightening XML parsing speed even in debug! Other than that, the DLL version is useless: In the release version of my tool, I always use the normal, ".cpp"-based, XMLParser Library (I simply include the xmlParser.cpp and xmlParser.h files into the project).

The file XMLNodeAutoexp.txt contains some "tweaks" that improve substancially the display of the content of the XMLNode objects inside the Visual Studio Debugger. Believe me, once you have seen inside the debugger the "smooth" display of the XMLNode objects, you cannot live without it anymore!

Debugging under LINUX/UNIX

The speed of the debug version of the XMLParser library is tolerable so no extra work.has been done.