note 38735 deleted from function.xslt-error by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 03:34:09 +0000 |
| Subject: | note 38735 deleted from function.xslt-error by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207364@lists.php.net to get a copy of this message | ||
Note Submitter: mikes at ayeltd dot biz
----
There may be cases where a null $result is legitimate, in this case add a test for non-zero
xlst_errno:
<?php
$xh = xslt_create();
$result = xslt_process($xh, 'dog.xml', 'pets.xsl');
if (!$result && xslt_errno($xh) > 0) {
die(sprintf("Cannot process XSLT document [%d]: %s",
xslt_errno($xh), xslt_error($xh)));
}
echo $result;
xslt_free($xh);
?>