note 91296 deleted from xsltprocessor.construct by salathe
| From: | salathe@php.net | Date: | Sun, 26 Oct 2014 15:20:00 +0000 |
| Subject: | note 91296 deleted from xsltprocessor.construct by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200732@lists.php.net to get a copy of this message | ||
Note Submitter: Martin
----
The example above is a bit confusing because it uses the same variable ($doc) for two different
things. I would rather write
<?php
$xsl = new XSLTProcessor();
$xsldoc = new DOMDocument();
$xsldoc->load($xsl_filename);
$xsl->importStyleSheet($xsldoc);
$xmldoc = new DOMDocument();
$xmldoc->load($xml_filename);
echo $xsl->transformToXML($xmldoc);
?>
[ Editor's note - thiago AT php DOT net: This note has improvements from Matthieu ]