note 28183 deleted from function.xslt-process by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 03:33:00 +0000 |
| Subject: | note 28183 deleted from function.xslt-process by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207352@lists.php.net to get a copy of this message | ||
Note Submitter: geiryork at start dot no
----
An important detail if you want to use the last argument to include parameters to the template:
<?PHP
xslt_process($xslt, 'foo.xml', 'foo.xslt', NULL, array(), array('foo'
=> 'FOO'));
?>
In the xsl file:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="foo"/>
<xsl:template match="/">
<xsl:value-of select="foo"/>
.........
Note the <xsl:param name="foo"/> is specified *outside* the template tag, but can be
referenced inside it.