Handling Errors

PHP’s XSLT API includes some functions designed specifically to assist in tracking and displaying errors. Depending on your requirements, you can set up a primitive error handler to display error codes and messages with the xslt_errno() and xslt_error() functions, or define a custom error handler with the xslt_set_error_handler() function.

Primitive Error Handling with xslt_errno() and xslt_error()

The xslt_errno() function returns the error code of the last error encountered by the XSLT processor, whereas the xslt_error() function generates a corresponding human-readable error message. Both functions require, as argument, a handle representing the current XSLT processor, as defined by xslt_create(). If no argument is provided, ...

Get XML and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.