Nick Wellnhofer > Plack-Middleware-XSLT > Plack::Middleware::XSLT

Download:
Plack-Middleware-XSLT-0.20002.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.20002   Source  

NAME ^

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

VERSION ^

version 0.20002

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 ^

cache
    enable 'XSLT', cache => 1;

Enables caching of XSLT stylesheets. Defaults to false.

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.

parser_options
    enable 'XSLT', parser_options => \%options;

Options that will be passed to the XML parser when parsing the input document. See "PARSER OPTIONS" in XML::LibXML::Parser.

HTTP EXCEPTIONS ^

If the transform exits via <xsl:message terminate="yes"> and the message contains a line starting with a three-digit HTTP response status code, a corresponding HTTP::Exception is thrown.

AUTHOR ^

Nick Wellnhofer <wellnhofer@aevum.de>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 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.

syntax highlighting: