Bug #15242 Updated: PHP functions as extensions for libxslt
| From: | chregu@php.net | Date: | Fri, 22 Feb 2002 09:17:10 +0000 |
| Subject: | Bug #15242 Updated: PHP functions as extensions for libxslt | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-790@lists.php.net to get a copy of this message | ||
ID: 15242
Updated by: chregu@php.net
Reported By: flying@dom.natm.ru
-Status: Open
+Status: Analyzed
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.1.1
New Comment:
I'm not sure, if this makes sense. You loose the whole interoperability
idea of xslt (your stylesheets will only run on PHP) and you will mix
again design and logic (ok, xslt allows you to do that already now..).
I do see, that it could be quite handy from time to time and maybe i
will implement it (some kind of evil eval...), but it's absolutely not
on top of my priority list.
Previous Comments:
------------------------------------------------------------------------
[2002-02-22 03:39:44] flying@dom.natm.ru
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)"/>
.....
------------------------------------------------------------------------
[2002-01-28 21:25:32] yohgaki@php.net
I don't use it (yet), but it's in PHP now.
------------------------------------------------------------------------
[2002-01-27 07:36:22] flying@dom.natm.ru
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