Chapter 1. libxml++

libxml++ is a C++ API for the popular libxml2 XML parser, written in C. libxml2 is famous for its high performance and compliance to standard specifications, but its C API is quite difficult even for common tasks.

libxml++ presents a simple C++-like API that can achieve common tasks with less code. Unlike some other C++ parsers, it does not try to avoid the advantages of standard C++ features such as namespaces, STL containers or runtime type identification, and it does not try to conform to standard API specifications meant for Java. Therefore libxml++ requires a fairly modern C++ compiler such as g++ 8 or g++ 9. libxml++ 3.9.1 and later require a C++17-compliant compiler.

But libxml++ was created mainly to fill the need for an API-stable and ABI-stable C++ XML parser which could be used as a shared library dependency by C++ applications that are distributed widely in binary form. That means that installed applications will not break when new versions of libxml++ are installed on a user's computer. Gradual improvement of the libxml++ API is still possible via non-breaking API additions, and new independent versions of the ABI that can be installed in parallel with older versions. These are the general techniques and principles followed by the GNOME project, of which libxml++ is a part.

Installation

libxml++ is packaged by major Linux and *BSD distributions and can be installed from source on Linux and Windows, using any modern compiler, such as g++ or MSVC++.

For instance, to install libxml++ and its documentation on Debian, use apt-get or synaptic like so:

    # apt-get install libxml++5.0-dev libxml++5.0-doc
    

To check that you have the libxml++ development packages installed, and that your environment is working properly, try pkg-config libxml++-5.0 --modversion.

Links for downloading and more documentation can be found at libxmlplusplus.github.io/libxmlplusplus. libxml++ is licensed under the LGPL, which allows its use via dynamic linking in both open source and closed-source software. The underlying libxml2 library uses the even more generous MIT licence.