June 2002
Intermediate to advanced
384 pages
7h 53m
English
If you need to pass data from the PHP script to the XSLT stylesheet, PHP’s xslt_process() function can be used to pass an associative arrays of parameters to the XSLT stylesheet.
You’ll remember that the xslt_process() function can accept an array containing parameter-value pairs as an optional sixth argument. These parameters can be passed on to the stylesheet and used within template rules.
Consider Listing 4.8, which creates an associative array named $params, and stores two elements containing the page title and current date in it. This associative array is then passed on to the stylesheet via the xslt_process() function.
<?php // set the filenames ... |
Read now
Unlock full access