|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10569 xslt_error handling
Submitted: 2001-04-30 19:37 UTC Modified: 2001-07-30 18:32 UTC
From: msopacua at idg dot nl Assigned:
Status: Closed Package: Sablotron XSL
PHP Version: 4.0.4pl1 OS: BSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: msopacua at idg dot nl
New email:
PHP Version: OS:


 [2001-04-30 19:37 UTC] msopacua at idg dot nl

again - the error handling issue.
I read the closed bugs and am surprised at the speed at which they are closed.

First of all - a documentation issue:
xslt_set_error_handler isn't documented. Thank you for mentioning it briefly, and then letting me figure out the arguments the called function needs.

Secondly - dying with a Fatal error, DOES occur, when the error handler isn't set! Even when using @xslt_process.

Try this one:

$xslData = '<xsl:stylesheet

<xsl:template match="article">
    <table border="1" cellpadding="2" cellspacing="1">
            <td width="20%">
            <td width="80%">
                <h2><xsl:value-of select="title"/></h2>
                <h3><xsl:value-of select="author"/></h3>
                <xsl:copy-of select="p"/>


$xmlData = '<?xml version="1.0"?>
    <title>Learning German</title>
    <author>Sterling Hughes</author>
        Essential phrases:
        K&#246;nnen Sie mir sagen, wo die Toilette ist?<br/>
        Ein grosses Bier, bitte!<br/>
        Noch eins, bitte.<br/>
function xsl_error($errno, $errstr)
	echo "\$errorstr: $errstr<BR>";
	return false;
if (@xslt_process($xslData, $xmlData, $result)) {
    echo "Here is the brilliant in-depth article on learning";
    echo " German: ";
    echo "<br>\n<br>";
    echo $result;
} else {
    echo "There was an error that occurred in the XSL transformation...\n";
    echo "\tError number: " . xslt_errno() . "\n";
    echo "\tError string: " . xslt_error() . "\n";

You won't see the closing body and html tags.

Uncommenting the xslt_set_error_handler() will. The errorstr output, however - is numeric.
So can we at least have updated documentation on how to trap errors? And how xslt_set_error_handler() must be used?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-30 18:32 UTC]
1. Your attitude won't get you anywhere
2. The new extension doesn't throw fatal errors and 
provides ample error handling (--enable-xslt 

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 04:03:36 2021 UTC