PApp::XSLT - wrapper for an XSLT implementation
use PApp::XSLT::Sablotron; use PApp::XSLT::LibXSLT; # to be written
The PApp::XSLT module is more or less a wrapper around an unnamed XSLT implementation (currently XML::Sablotron or XML::LibXSLT, should be moderately easy to add XML::Transformiix or XML::XSLT).
stylesheet see the C<stylesheet> method. get_<scheme> see the C<scheme_handler> method.
stylesheet([stylesheet-uri])
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 ;).
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.
$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).
apply
-method with the uri data:,xml-doc
,
i.e. this method applies the stylesheet to the string.
Marc Lehmann <pcg@goof.com> http://www.goof.com/pcg/marc/