Just comitted a patch to the PHP 5 ext/xsl extension, which makes it possible to call any PHP function from within your XSLT stylesheets. While this is pure evil for purists (and you certainly can shoot yourself in the foot with this), it can come quite useful in some cases (if you don't have to write cross-processor XSLTā€¦). Anyway, here's a

short XSLT example:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" version='1.0'>


<xsl:template match="/">


<xsl:value-of select="php:function('date', 'r')"/>


</xsl:template>


</xsl:stylesheet>

This would output the current date as defined in RFC822. Like date(ā€˜r') in PHP does. Therefore the first argument is the name of the function, the next ones are the usual parameters to this function. You can of course also call your self-defined functions.

I will try to write a little Tutorial in the next few days (How to use ext/xsl at all is described on my slides from this year's php-conference).

And by the way, EXSLT support was also added to ext/xsl lately