DCMTK
Version 3.6.9
OFFIS DICOM Toolkit
|
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.
Copyright (c) 2002, Frank Vanden Berghen All rights reserved.
The following license terms apply to projects that are in some way related to the "DCMTK project", including applications using "DCMTK project" and tools developed for enhancing "DCMTK project". All other projects (not related to "DCMTK project") have to use this code under the Aladdin Free Public License (AFPL) See the file "AFPL-license.txt" for more information about the AFPL license. (see http://www.artifex.com/downloads/doc/Public.htm for detailed AFPL terms)
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY Frank Vanden Berghen `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can follow a simple Tutorial to know the basics...
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 "WIDE_CHAR_XML_PARSER" preprocessor definition variable (this is usually done inside your project definition file)
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 additional examples before sending an e-mail to the author.
To build the examples:
In order to build the examples you need some additional files:
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 lightning 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!
The speed of the debug version of the XMLParser library is tolerable so no extra work.has been done.