xslt_create

Create a new XSLT processor (PHP 4 >= 4.0.3)
resource xslt_create ( )

Create and return a new XSLT processor resource for manipulation by the other XSLT functions.

Example 1023. xslt_create() example

<?php
function xml2html($xmldata, $xsl) {
   
/* $xmldata -> your xml */
   /* $xsl -> xslt file */    

   
$path = 'include';
   
$arguments = array('/_xml' => $xmldata);
   
$xsltproc = xslt_create();
   
xslt_set_encoding($xsltproc, 'ISO-8859-1');
   
$html =
       
xslt_process($xsltproc, 'arg:/_xml', "$path/$xsl", NULL, $arguments);

   if (empty(
$html)) {
      die(
'XSLT processing error: '. xslt_error($xsltproc));
   }
   
xslt_free($xsltproc);
   return
$html;
}            
?>

See also xslt_free().

This HTML Help has been published using the chm2web software.