Introduction to libxml2
The libxml2 package contains
libraries and utilities used for parsing XML files.
Note
Development versions of BLFS may not build or run some packages
properly if LFS or dependencies have been updated since the most
recent stable versions of the books.
Package Information
Additional Downloads
libxml2 Dependencies
Required
git-2.51.1
(used by meson during configuration to determine the version of
libxml2 being built)
Recommended
ICU-77.1
Optional (for generating the documentation)
Doxygen-1.14.0 and libxslt-1.1.43
Installation of libxml2
Install libxml2 by running the
following commands:
mkdir build &&
cd build &&
meson setup .. \
--prefix=/usr \
-D history=enabled \
-D icu=enabled &&
ninja
If you wish to build and install the manual pages and the
documentation, you should have libxslt-1.1.43 and Doxygen-1.14.0 installed,
and run:
sed -e "/^dir_doc/s/\$/ + '-' + meson.project_version()/" \
-i ../meson.build &&
meson configure -D docs=enabled &&
ninja
If you downloaded the test suite, issue the following command:
tar xf ../../xmlts20130923.tar.gz -C ..
To test the results, issue: ninja
test.
Note
The tests use http://localhost/ to test parsing of
external entities. If the machine where you run the tests serves
as a web site, the tests may hang, depending on the content of
the file served. It is therefore recommended to shut down the
server during the tests, as the root
user:
/etc/init.d/httpd stop
Now, as the root
user:
ninja install
Command Explanations
-D history=enabled
: This
switch enables Readline support
when running xmlcatalog or xmllint in shell mode.
-D icu=enabled
: This switch
enables support for ICU, which
provides additional Unicode support. This is needed for some
packages in BLFS, such as for QtWebEngine.
-D python=enabled
: This switch enables
the libxml2 Python bindings. Note that those bindings are
deprecated due to flaws in the API design and they will be removed
in libxml2-2.16.