INSTALL

(OUTDATED) Installing mod-xslt is currently a rather maual task.

First make sure that the required packages are installed.
	-	libxml2
	-	libxslt
	-	apache (> 2.0.35)

When you have those done, make sure your paths are correct.
there are a few presumptions ,made. I work on a Redhat 7.2 (8.0 by now, but things are the same here)
and used the rpms to install the libraries.

The ./configure script checks for a lot of things. If it can't find something you will be asked to supply it with an option.
Here are the current options:
--with-apxs=FILE	Specifies where the apache apxs utility is if it's not on your path you need this
--with-apachectl=FILE	Specifies where the apache apachectl utility is if it's not on your path you need this
--with-apache-include=DIRECTORY	Where are your apache headers located (If it can't figure it out by schecking /usr/include/httpd/ or apxs -q INCLUDEDIR)
--with-apache-modules=DIRECTORY Where are modules supposed to go (If it can't figure out by checking /usr/lib/httpd/modules/ or apxs -q LIBEXECDIR)
--with-apachae-documents=DIRECTORY Where is your document root (if /var/www/html/ does not exist)
--with-apachae-config=DIRECTORY Where is your httpd.conf (if not /etc/httpd/conf/)

If you have a standard install of libxml2 and libxml2-devel you need to read README.LIBXML2 for some things to do before running configure.
(Basically: cd /usr/include && ln -s libxml2/libxml libxml)

If you have a virgin installation of httpd (Such as provided by RedHat 8.0) you can just
./configure
make install
make config

Otherwise just
.configure
make install
Do configuration Manually!!!
make sure you are root for the compile and install. If you are root chances are apxs and apachectl are on your path, which eliminates a lot of options for ./configure !


Manual Configuration:

First you need to add:
LoadModule mod_xslt modules/mod-xslt.so

after all teh other LoadModule Directives in your httpd.conf

mod-xslt is now being loaded. I usually choose to have it filter all xml content, which can be 
achieved by adding:

AddOutputFilterByType mod-xslt text/xml

to the <Directory "/var/www/html"> section or wherever your webspace is.

Optionally you can use a configuration Directive
XSLTSetStylesheet <mime-type> <url to stylesheet>
in a <Directory> directive to se a default Stylesheet to be used for a given MimeType
Be aware that the URL is still relative to the XML. If you want an absolute URL, specify it as such!!! (Changed just before 1.0.5a)

One further Pitfall to be aware of is that Apache assigns the mime-type text/xml to XSL-Files. Therefore with the AddOutputFilterByType from above mod-xslt also parses XSL-Files. This will cause a mess if a default Stylesheet is specified and the Stylesheet resides in that Directory and the Stylesheet is specified using a full url like http://somhost.com/stylesheet.xsl
A simple solution would be to assign the extension xsl the mime-type text/xsl (which is also valid according to Danny Vellard(Author of libxml/lixslt). If you don't want to do that you can always have your Stylesheets reside in a different directory. If you don't heed this warning, Apache might get caught in a loop. Trying to parse a stylesheet with itsself parsed with itsself...

XSLTUnsetStyleSheet <mime-type> is now supported. This way you can clear a stylesheet setting for a subdirectory.

After restarting Apache all content of type text/xml will be parsed by mod-xslt

You could also add

AddOutputFilter mod-xslt .xml

(or AddOutputFilter mod-xslt .cgi for that matter)

if you wanted to handle a specific extension, but you need to make sure
that the extension is mime-typed text/xml within your mimeconfig

Have Fun

philipp@dunkel.org
