The libxml2dom package provides a traditional DOM wrapper around the Python bindings for libxml2. In contrast to the libxml2 bindings, libxml2dom provides an API reminiscent of minidom, pxdom and other Python-based and Python-related XML toolkits. Performance is disappointing, given the typical high speed of libxml2 processing, but this is to be expected since large numbers of Python objects are instantiated at two levels of document tree representation. However, serialisation of documents is much faster than many other toolkits because it can make direct use of libxml2.
For reasons of consistency, libxml2dom uses the same MIT-style licence as
libxml2. See the file COPYING.txt
in the docs
directory within the source code distribution.
The following descriptions identify dependencies and describe appropriate installation issues with each dependency:
Building libxml2 from source and configuring the Python bindings can be done as follows:
cd libxml2-2.6.0 ./configure --with-python=/usr/local/bin/python make
If you are to use an installation of Python installed outside
/usr/local
then specify the "prefix" accordingly. Install
(possibly as root
) in the usual way:
make install
The patches
directory in the source code distribution
contains a patch against libxml2 2.5.7 which resolves an issue exposed by
libxml2dom. Although it is recommended that later releases of libxml2 are
used instead, the source code distribution of libxml2 2.5.7 can be patched as
follows:
patch -p0 < libxml2dom/patches/libxml2/libxml.c.diff
The command should be run outside/above the libxml2-2.5.7
directory, and the stated path should be adjusted accordingly.
Python releases from 2.2 onwards should be compatible with libxml2dom. The principal requirement from such releases is the new-style class support which permits the use of properties in the libxml2dom implementation, thus simplifying the code somewhat.