Introduction to libxml2
        
        
          The libxml2 package contains
          libraries and utilities used for parsing XML files.
        
        
          This package is known to build and work properly using an LFS 12.0
          platform.
        
        
          Package Information
        
        
        
          Additional Downloads
        
        
        
          libxml2 Dependencies
        
        
          Optional
        
        
          ICU-73.2 (see
          below) and Valgrind-3.21.0 (may be used in the tests)
        
        
       
      
        
          Installation of libxml2
        
        
          Install libxml2 by running the
          following commands:
        
        ./configure --prefix=/usr           \
            --sysconfdir=/etc       \
            --disable-static        \
            --with-history          \
            PYTHON=/usr/bin/python3 \
            --docdir=/usr/share/doc/libxml2-2.10.4 &&
make
        
          If you downloaded the test suite, issue the following command:
        
        tar xf ../xmlts20130923.tar.gz
        
          To test the results, issue: make
          check > check.log. A summary of the results can
          be obtained with grep -E
          '^Total|expected' check.log. If Valgrind-3.21.0 is
          installed and you want to check for memory leaks, replace
          check with
          check-valgrind.
        
        
          ![[Note]](../images/note.png) 
          
            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:
        
        make install
       
      
        
          Command Explanations
        
        
          --disable-static: This
          switch prevents installation of static versions of the libraries.
        
        
          --with-history: This switch
          enables Readline support when
          running xmlcatalog or
          xmllint in shell
          mode.
        
        
          PYTHON=/usr/bin/python3:
          Allows building the libxml2 module with Python3 instead of Python2.
        
        
          --with-icu: Add this switch if you have
          built ICU-73.2, for better unicode support.
        
        
          ![[Note]](../images/note.png) 
          
            Note
          
          
            If the --with-icu switch is used, the
            BLFS editors recommend removing unneeded references to the ICU
            libraries. This will prevent many packages that use libxml2 from
            unnecessarily linking to the ICU libraries. This, in turn, will
            prevent the need for rebuilding many packages when upgrading ICU
            to a new major version. After installing libxml2, as the
            root user, issue:
          
          rm -vf /usr/lib/libxml2.la &&
sed '/libs=/s/xml2.*/xml2"/' -i /usr/bin/xml2-config