Fikin posted today in a mail to the xslt mailinglist, that he implement JavaScript Support for libxslt (or technically more accurate, the EXSLT extension of libxslt). It uses the Mozilla Spidermonkey engine, and he plans

to add support for python.

If this gets included, you'll be able to define JavaScript functions in XSLT:

<func:script language="javascript" implements-prefix="js" >


function my_func() {


return 'whatever';


}


</func:script>

and use that function like any other function in XSLT, something Sablotron (and others) is capable of doing since a long time..).

By the way and in case you missed it. PHP 5's XSLT support is capable of handling PHP functions within an XSLT stylesheet. A different approach, but it's possible. See here and here for more details