note 48416 added to ref.xsl
| From: | kekoajs at yahoo dot com | Date: | Wed, 22 Dec 2004 22:07:54 +0000 |
| Subject: | note 48416 added to ref.xsl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82189@lists.php.net to get a copy of this message | ||
Wow, I spent the better part of a day looking for how one could pass an entire test expression to an
XSL stylesheet. It seems that the XSLT 1.0 specification doesn't support it but PHP 5 (and
maybe 4s) inclusion of EXSLT allows one to do exactly that...
simply add these lines...
xmlns:dyn="http://exslt.org/dynamic"
extension-element-prefixes="dyn"
to the <xsl:stylesheet> element and when using an expression stored in a <xsl:param>
element write
<xsl:if test="dyn:evaluate($param-name)">
and viola! you can now use expressions generated externally in your stylesheet!
EXSLT adds many useful functions that can be integrated into your XSL in a similar fashion. You can
go to http://exslt.org/ to learn more...
----
Manual Page -- http://www.php.net/manual/en/ref.xsl.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48416
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48416&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48416&report=yes
Search -- http://master.php.net/manage/user-notes.php