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);
?>
xslt_error
(PHP 4 >= 4.0.3)
xslt_error — Return the current error string
Description
Return the current error string of the given XSL processor. If no handle is given, the last error string that occured anywhere is returned.
xslt_error
mikes at ayeltd dot biz
05-Jan-2004 02:18
05-Jan-2004 02:18
