3.3. libxml

Within this tutorial the primary purpose for installing the libxml C library will be to gain access the tools that come with it. The tools provide the means to validate and transform XML files. In this tutorial, the program xmllint will be used to validate XML DocBook files before processing. The program xsltproc can be used to transform XML files. It is a program which uses XSLT.

To install libxml on a Windows machine one needs to download the Windows binaries and libraries. These can be obtained from http://www.zlatkovic.com/pub/libxml/. Download the following:

[Note]Note

The three links shown immediately above may be broken since it is common practice to remove old versions from a download page when they are obsoleted. Goto http://www.zlatkovic.com/pub/libxml/ instead and download the libxml2..., libxslt..., and iconv... files with the highest version numbers. Some older versions are available in the directory oldreleases on that server, should one desire them.

It is not necessary to extract the content of these zips entirely, instead the required functionality will be extracted. Create a suitable directory to contain the stuff that is about to be extracted. For example, on my home machine. If I am running a Windows system I have a directory called c:\tools which contains all the tools I install. Within c:\tools I have a directory called libxml that contains the stuff I want from these zips. Create a suitable directory to extract the desired content from the zips into.

Extract the following files from the libxml archive into the directory.

  • libxml2.dll

  • xmllint.exe

Extract the following files from the libxslt archive into the directory.

  • libexslt.dll

  • libxslt.dll

  • xsltproc.exe

Extract the following files from the iconv archive into the directory.

  • iconv.dll

  • iconv.exe

Append \directory\you\just\unzipped\everything\to to the PATH environment variable.

You might not use all the tools but they are worth having around in case you decide you need them.

These files are probably already installed on your system, as most modern distributions of these operating systems use XML processing for some of the more popular components. But you may wish to get the latest versions, in which case, goto ftp://xmlsoft.org/ and get the latest libxml2 and libxslt. There are gzipped tars and RPMs available, download whichever you prefer. A list of the latest files at the time of writing is shown below:

        libxml2-2.4.25.tar.gz
        libxml2-2.4.25-1.i386.rpm
        libxml2-2.4.25-1.src.rpm
        libxslt-1.0.21.tar.gz
        libxslt-1.0.21-1.i386.rpm
        libxslt-1.0.21-1.src.rpm
      

The ftp directory also contains devel versions of the software, this is for people who want to develop with libxml.