XSLT2 is a Nginx filter module providing the post-process of pages with XSLT. This is a modification of Igor Sysoev's XSLT module with a few improvements.
Put all sources to correct directories: (*.c, *.h, config)
When compiling from source use standard -add-module option as below:
./configure --add-module=src/http/modules/xslt2 --add-module=src/http/modules/download --add-module=src/http/modules/mxcache
After configure simply compile and install nginx from terminal:
make make install
XSLT2 Module:
MXCache Module:
Download Module:
location /xml { xslt2 on; xslt2_cache_expire 5m; xslt2_cache_timeout 200ms; xslt2_download_timeout 1500ms; mxcache on; mxcache_server_ip 127.0.0.1; mxcache_server_port 11211; }
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="stylesheet.xsl" ?> <?xml-stylesheet type="text/xsl" href="http://domain.com/stylesheet.xsl" ?> <xmlroot> [...] </xmlroot>
Module will transform XML using declared XSL stylesheets. It differs from Nginx XSLT module written by Igor Sysoev, because stylesheets are declared directly in XML documents and could be downloaded using http protocol (in Sysoev's XSLT module stylesheets are declared in server configuration). External style sheets can be downloaded only via http protocol. URL has to begin with http:// prefix. Stylesheets are cached if mxcache module is enabled.