Hi

> > what does it mean:
> >
> > Warning: msgtype: warning in x:/www/temp/max.php on line 5
> > Fatal error: msgtype: error in x:/www/temp/max.php on line 5
> >
> > in max.php script:
> > <?php
> > $xmlData = join ('', file ('atomic.xml'));
> > $xslData = join ('', file ('atomic.xsl'));
> >
> > xslt_process($xslData, $xmlData, $result);
> > print($result);
> > ?>
> >
> > It runs on win98+Sablotron0.5+Apache1.13+PHP 4.0.4
> > Atomic.xml and atomic.xsl are well-formed.
> > Sablotron module looks throw phpinfo() function.
>
> Have you tried with "sabcmd" ?
>
> The PHP module doesn't seem to be verbose when reporting errors.
> When encountering such errors, I run the XSL through sabcmd which gives
> me an error message with line number :-)

 The more powerful way is to set your own XSLT error handler in PHP:

-----------------------------------------------------
 function xslt_error_handler( $errno, $level, $fields )
   {
    if( $level == 1 ) return;    // log level message

    if( $errno == 464 )  return; // skip "unsupported language 'en'" message
in xsl:sort

    $error_str = "XSLT processing error\n";
    $error_str .= "errno: ".$errno."\n";
    $error_str .= "level: ".$level."\n";

    $error_str .= "fields: \n";

    while (list ($key, $val) = each ($fields))
       $error_str .= $key." => ".$val.";\n";

    if( $level <= 2 )
      your_global_error_processing_function( "XSLT_error_handler",
$error_str, warning );
    else
      your_global_error_processing_function( "XSLT_error_handler",
$error_str, error );
   }

 xslt_set_error_handler("xslt_error_handler");
-----------------------------------------------------

With best regards,
   Alexander Veremyev.


Reply via email to