Stefan Behnel wrote:
Hi,
since we often have requests regarding better error reporting in lxml, I implemented a little error log. lxml now keeps a bounded list of output messages from libxml2/xslt (that normally appear on stdout) and provides access to the log entries through its exceptions.
LxmlException objects now have an additional attribute "error_log" that contain the last log entries (up to 20 by default). So, if an exception is raised, whoever catches it can print out the error messages from libxml2/xslt to see where things went wrong.
This behaviour can be switched on or off at compile time and defaults to off. If off, the attribute simply stores an empty tuple.
What's the motivation for defaulting this to 'off'?
I hope that comes close to what was asked for.
This sounds very useful! Great! How precise is this information? Do we see the last 5 lines for an XML parsing error that occured earlier in a later XSLT reception? We also have the case for RelaxNG/Schema reporting where no exception is raised if the XML is not valid according to the schema. Regards, Martijn