I have in the non-php5 functions, but I assume you can do similar with the new way.
The last argument would be an array of parameters used in your xsl stylesheet, with the names as the keys.
mixed xslt_process ( resource xh, string xmlcontainer, string xslcontainer [, string resultcontainer [, array arguments [, array parameters]]] )
So something like:
Code: Select all
$arguments = array(
'/_xml' => $xml,
'/_xsl' => $xsl
);
$parameters = array("param1" => 100, "param2" => 10);
// Allocate a new XSLT processor
$xh = xslt_create();
// Process the document
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments, $parameters);
Then your xsl would have:
Code: Select all
<param name="param1"></param>
<param name="param2"></param>
Before any of your template match stuff, and you can use the params like constants...