PHP-Funktion in XSL / XSLT

A PHP function can be executed in XSL without any problems using the XSLTProcessor::registerPHPFunctions directive.

However, this cannot be used to create arrays that could, for example, provide different filenames for the dynamic creation of an image gallery (application: SobiPro component in a Joomla website). In this case, it is advisable to first convert the array into a string in PHP and then, after executing the PHP function and passing the string, split it back into its individual elements within XSL / XSLT. The string can then be parsed in XSL / XSLT by defining and recursively calling suitable templates.

... back to the blog