Proper XPath/XSLT error reporting in XML::LibXSLT. The patch

UPDATE: This post and this patch are no longer needed. A new version of XML::LibXSLT fixes the error reporting and some other issues. Below is the original post for purely historical reasons.


XML::LibXSLT is a perl module, written and maintaned by Matt Sergeant. The module provides access to the fine Gnome project’s XSLT library libxslt. XML::LibXSLT versions up to and including 1.58 have one serious deficiency though: they provide rudimentary reporting of XPath and XSLT processing errors.

This patch tries to fix this deficiency and makes XML::LibXSLT die in case of error with a full error message, often multiple lines. The generated message will be similar to the one xsltproc tool would produce.

Get the patch

Download: xml-libxslterror-reporting-patch.txt

A summary of the patch changes follows.

Continue reading