eXtended XSL TransformationsNginx module for XSL Transformations

DESCRIPTION

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.

  1. It allows to declare XSL style sheet directly in processed XML - in XSLT module only in Nginx configuration.
  2. Style sheets can be local or external - in XSLT module only local.
  3. Style sheets can be cached to avoid unnecessary downloads or disk reads.

INSTALLATION

Put all sources to correct directories: (*.c, *.h, config)

COMPILATION

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

CONFIGURATION

XSLT2 Module:

MXCache Module:

Download Module:

EXAMPLE CONFIGURATION

  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;
  }

MODULE USAGE EXAMPLE

Transform XML documents using XSL stylesheets

<?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.

License

XSLT2 is licensed under the Apache License, Version 2.0 which you can obtain from: http://www.apache.org/licenses/LICENSE-2.0