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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Perl XPath functions (Score:1)
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.
Reply to This
Re:Perl XPath functions (Score:2)
--Nat