PApp::XSLT - wrapper for an XSLT implementation
use PApp::XSLT; # try to find any implementation, OR use PApp::XSLT::Sablotron; # choose sablotron use PApp::XSLT::LibXSLT; # or choose libxslt use PApp::XSLT; # before loading PApp::XSLT
The PApp::XSLT module is more or less a wrapper around an unnamed XSLT implementation (currently XML::Sablotron or XML::LibXSLT, chosen at runtime, should be moderately easy to add XML::Transformiix or XML::XSLT).
Creates a new PApp::XSLT object with the specified behaviour. All parameters are optional.
stylesheet see the C<stylesheet> method. get_<scheme> see the C<scheme_handler> method.
Set the stylesheet to use for later transformation requests by specifying a uri. The only supported scheme is currently data:,verbatim xml stylesheet text (the comma is not a typoe, see rfc2397 on why this is the most compatible form to the real data: scheme ;).
data:,verbatim xml stylesheet text
If the stylesheet is a code reference (or any reference), it is executed for each invocation and should return the actual stylesheet to use.
It always returns the current stylesheet.
Set a handler for the given uri scheme. The handler will be called with the xslt object, the scheme name and the rest of the uri and is expected to return the whole document, e.g.
$xslt->set_handler("http", sub { my ($self, $scheme, $uri) = @_; return "<dokument>text to be returned</dokument>"; });
might be called with (<obj>, "http", "www.plan9.de/"). Hint: this function can easily be abused to feed data into a stylesheet dynamically.
Not all implementations support this method.
When the $handler argument is undef, the current handler will be deleted. If it is missing, nothing happens (only the old handler is returned).
undef
Apply the document (specified by the given document-uri) and return it as a string. Optional arguments set the named global stylesheet parameters.
The same as calling the apply-method with the uri data:,xml-doc, i.e. this method applies the stylesheet to the string.
apply
data:,xml-doc
PApp.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
To install PApp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PApp
CPAN shell
perl -MCPAN -e shell install PApp
For more information on module installation, please visit the detailed CPAN module installation guide.