3.5. Sablotron

Sablotron is an XSLT processor. Unfortunately, RedHat does not provide a package for it, so we compiled it ourselves. This is a two step installation process: The Sablotron library and the PHP (XSLT) extension.

Before building Sablotron itself, it's necessary to install the development environment for expat, the XML library that Sablotron depends on. This can be done on Red Hat by installing the packages expat and expat-devel

Download Sablotron from its web-site. You can either install from the RPM provided on that site, or download and build the source code:


	  cd Sablotron-..
	  ./configure
	  make
	  sudo make install
	
Now the Sablotron library is installed in /usr/local.

Get the source for the PHP that you're using. If RedHat package php-4.2.2 is installed, you should fetch source for PHP 4.2.2, most easily using a Source RPM (SRPM). Now, configure the xslt extension.


	  cd php-4.2.2
	  cd ext/xslt
	  phpize
	  ./configure  --enable-xslt --with-xslt-sablot=/usr/local
	  make
	  sudo make install
	

If configure above fails with a complaint about iconv, remove the following line in php-4.2.2/ext/xsl/config.m4


     PHP_SETUP_ICONV(XSLT_SHARED_LIBADD, [], [
       AC_MSG_ERROR([iconv not found, in order to build sablotron you
                                              need the iconv library])
     ])
	
and run phpize, configure again. (This problem is caused by the PHP configuration script's assumption that the iconv character-set mapping functionality is installed as its own library, whereas in some operating systems, including Red Hat 9, the iconv code is included in the universal C library.)

Enable the XSLT extension in PHP itself by adding the following in /etc/php.ini:


	  extension=xslt.so
	

Or, on operating systems such as Red Hat 9 that support modular configuration of PHP extensions, create a file /etc/php.d/xslt.ini containing this line.