INSTALL for mod-xslt 
====================

Required packages:
==================
* libxml2 		[latest 1.0.26]
* libxslt		[latest 2.5.3]
* apache (> 2.0.35) 	[latest 2.0.44]

NOTE: You need to have them installed before you run "configure".

Compiling:
==========
NOTE: Make sure you are root before running configure. Also check to make sure that apxs and apachectl 
are on your path (which eliminates a lot of options for "configure"). 
NOTE: apxs and apachectl are usually located in your apache/bin directory.

As root just type:
./configure
If everything goes ok, then:
make
make install


Configure 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-apache-documents=DIRECTORY 	Where is your document root (if /var/www/html/ does not exist)

--with-apache-config=DIRECTORY 		Where is your httpd.conf (if not /etc/httpd/conf/)


Apache Configuration:
=====================

First you need to add:

	LoadModule mod-xslt modules/mod-xslt.so


after all the 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> 
	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

Phillip Dunkel <philipp@dunkel.org>
Gennady Feldman <gena01@gena01.com>
