PHP5 libxslt - Use registerPHPFunctions() and php:function() within <XSL:INCLUDE/> ?

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

PHP5 libxslt - Use registerPHPFunctions() and php:function() within <XSL:INCLUDE/> ?

In PHP4 I have been using the XSLT Sablotron library a lot in various projects. I am now in the proces of changing my applications to make them compatible with PHP5 and run into a serious problem:

With Sablotron i used to include templates in my xsl templates using the PHP schemeHandler function, like this:

<xsl:include href="content:link_edit"/>

In the schemHandler in PHP i select the right function based on the scheme ('content' in above example) and return the xsl template 'link_edit' which is available as a string in PHP (loaded from a database).

In PHP5 this seems impossible. There is now the option of calling php functions using registerPHPFunctions() and the php namespace, like this:

ooh, you're fast!! I was just finalizing the required method url_stat() when I saw your post coming in

My own test works perfectly also now.. just tried it with a global variable where I loaded the xsl template. Will now modify it to load the templates from classes in my project, and load them based on the specified path.