ID: 15242 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Closed +Status: Open Bug Type: Feature/Change Request -Operating System: +Operating System: Any PHP Version: 4.1.1 New Comment:
Current version of DOM XML module, available in CVS only have support for EXSLT, now available into libxslt. But this feature request means adding possibility for PHP developers to define their own extension functions/extension elements for XSLT, written directly in PHP. According to libxslt documentation (http://xmlsoft.org/XSLT/extensions.html) DOM XML module in PHP should have a kind of converter between PHP functions and extension functions for libxslt. From a PHP's point of view it should look like this: PHP: ==== <?php // Creating new stylesheet $xsl = new XsltStylesheet(); $xsl->register_ns('ext','http://www.my-extensions.com/'); // Register custom extension function // At enter we give name of it, which will be used in XSLT // and name of actual PHP function $xsl->register_extension_function('ext:my_func','myExtension'); function myExtension(p1,p2,p3) { return(p1+p2+p3); }; ?> XSLT: ===== ..... <xsl:value-of select="ext:my_func(2,3,4)"/> ..... Previous Comments: ------------------------------------------------------------------------ [2002-01-28 21:25:32] [EMAIL PROTECTED] I don't use it (yet), but it's in PHP now. ------------------------------------------------------------------------ [2002-01-27 07:36:22] [EMAIL PROTECTED] Since DOM XML extension now have a code to work with libxslt (at least version of DOM XML extension, available in CVS) and libxslt have an ability to create extensions for XSLT it will be absolutely great to allow writing extensions on PHP. Is there any plans to implement this functionality? Because sometimes it is very important. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15242&edit=1