Skip to main content

The PreTeXt Guide

Section L.2 Installing xsltproc

Subsection L.2.1 xsltproc binaries

This is the most annoying part of the installation. Obtain four zip archives from Igor Zlatkovic’s FTP site
 1 
ftp://ftp.zlatkovic.com/libxml
that hosts the most recent Libxml binaries for Windows. At the time of this writing, the 64-bit binaries were considered experimental. I have had no trouble using the 32-bit binaries on my 64-bit Windows 7 system, so I suggest that all PreTeXt users download the most recent 32-bit version of the following libraries:
List L.2.1. xsltproc Zip Files
  1. iconv (filename something like iconv-1.9.2.win32.zip)
  2. libxml2 (filename something like libxml2-2.7.8.win32.zip)
  3. libxslt (filename something like libxslt-1.1.26.win32.zip)
  4. zlib (filename something like zlib-1.2.5.win32.zip)
We only need a handful of files from these archives. So the simplest thing is to leave them in your Downloads folder and grab what we need. Create a new folder C:\xsltproc (it can be anywhere, as long as it’s a new location). We’ll call this location <xsltproc> in case you named your folder something different.
Extract the following files from the four zip archives you downloaded above into <xsltproc>:
List L.2.2. xsltproc Extracted Zip Files
  1. From iconv-*.win32.zip:
    1. iconv-*.win32\bin\iconv.dll
  2. From libxml2-*.win32.zip:
    1. libxml2-*.win32\bin\libxml2.dll
    2. libxml2-*.win32\bin\xmllint.exe
  3. From libxslt-*.win32.zip:
    1. libxslt-*.win32\bin\libexslt.dll
    2. libxslt-*.win32\bin\libxslt.dll
    3. libxslt-*.win32\bin\xsltproc.exe
  4. From zlib-*.win32.zip:
    1. zlib-*.win32\bin\zlib1.dll

Subsection L.2.2 Change PATH environment variable

Note: if you prefer not to meddle with this, it can be avoided. Now, we need to make sure your system can find these files when we need them.
List L.2.3. Path Environment Variable for xsltproc
  1. Open the Start menu and start typing “Edit the system environment variables”. Select this option when it becomes visible.
  2. Click the Environment Variables button near the bottom of the dialog.
  3. In the bottom part of the dialog labeled “System environment variables”, look for a variable named PATH. You may need to scroll.
    1. If you do not find one, create it using the New... button. Make sure to use all capital letters. (This really shouldn’t happen. Make sure you are editing the system environment variables, not the user environment variables.)
    2. If you do find the PATH variable, select it and click the Edit... button.
  4. Regardless of which of steps 1 and 2 you followed, now you should see a dialog with two text fields. Your variable name should be PATH.
  5. If you created this variable, populate the second field with the full path name of <xsltproc>, the location where you put the seven files from Igor’s zip archives. For me this looks like C:\xsltproc.
  6. If you are editing the PATH variable, place the cursor in the existing value and press the End key, so that the cursor moves to the back of the line. The PATH string is a ;-delimited list of full path names, so append the string <xsltproc>; (note the semicolon) to the existing value. If you named <xsltproc> as we suggested above, then the last part of your PATH variable is now C:\xsltproc;.
  7. Click OK to save changes.
Congratulations, you have successfully installed xsltproc.
Note that you have installed the xmllint utility as part of this procedure. This utility will allow some text editors to lint your PreTeXt files, that is, to automatically detect and highlight errors, and perhaps even to explain them.