NAME

Plack::Middleware::XSLT - XSLT transformations with Plack

VERSION

version 0.10001

SYNOPSIS

# in your .psgi

enable 'XSLT';

# in your app

$env->{'xslt.style'} = 'stylesheet.xsl';

return [ 200, $headers, [ $xml ] ];

DESCRIPTION

Plack::Middleware::XSLT converts XML response bodies to HTML, XML, or text using XML::LibXSLT. The XSLT stylesheet is specified by the environment variable 'xslt.style'. If this variable is undefined or empty, the response is not altered. This rather crude mechanism might be enhanced in the future.

The Content-Type header is set according to xsl:output. Content-Length is adjusted.

CONFIGURATION

path
enable 'XSLT', path => 'path/to/xsl/files';

Sets a path that will be prepended if xslt.style contains a relative path. Defaults to the current directory.

cache
enable 'XSLT', cache => 1;

Enables caching of XSLT stylesheets. Defaults to false.

AUTHOR

Nick Wellnhofer <wellnhofer@aevum.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nick Wellnhofer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.