Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Nat -

    Don't forget to talk about XML::LibXSLT's ability to write and register XPath extension functions written in Perl. :-)

    Of course 1.53 has memory bugs, but if you get Matt's CVS copy, you can have Perl callbacks from XSLT. This is incredibly useful; say you want access Apache req objects from XSLT, using closures, in a handler().

        $xslt->register_function($urn, 'get_request', sub { &get_request($self,@_) } );

    Write get_request() to handle arguments to an XPath function (which can be strings or XML, and you can return (from the subroutine) strings or XML fragments to the XSLT XPath function. I use it to get parameters, set cookies, login users, etc. It's transparent as far as the XSLT goes.