Re: [xslt] python xslt messages



On Wed, 17 Apr 2002, Daniel Veillard wrote:

> On Wed, Apr 17, 2002 at 03:41:51PM -0400, Sam Brauer wrote:
> > On Fri, 12 Apr 2002, Daniel Veillard wrote:
> > I experimented with this, but its behavior seems a little weird (to me 
> > anyway).  I'm including a short example script that uses 
> > libxml2.registerErrorHandler.  If I run it in a case where either the 
> > stylesheet or document file is missing (which is the case tested by 
> > error.py that comes with the package), then it works great.
> > It also works great if both files exist but one is not well-formed.
> > 
> > 
> > But consider these cases:
> > 
> > Case 1. The stylesheet is well-formed, but contains an invalid xsl tag, 
> > such as <xsl:foo/>
> > 
> > stderr:
> > compilation error: file test.xsl element foo
> > xsltStylePreCompute: unknown xsl:foo
> > compilation error: file test.xsl element foo
> > xsltParseStylesheetTop: ignoring unknown foo element
> > 
> > error handler:
> > None   (error handler wasn't called)
> > 
> > 
> > Case 2. The stylesheet is well-formed, but refers to an undeclared 
> > variable.
> > 
> > stderr:
> > runtime error: file test.xsl element for-each
> > unregistered variable foo
> > 
> > error handler:
> > xmlXPathCompiledEval: evaluation failed
> > 
> > 
> > 
> > In both of these cases, messages are going to stderr that I would like to 
> > be able to collect with a callback.  Does the API currently provide some 
> > way to do this?
> 
>   I can't analyze this at the moment, could you please log it in bugzilla
> so I don't forget about it ?
> 
>   thanks,
> 
> Daniel
> 
>



I just posted it as bug# 79105 "python xslt error message handling 
incomplete?".

Thanks for your help!

In the meantime I may experiment with capturing stderr before making the 
calls to libxml2 and libxslt, then restoring it afterwards and checking to 
see if I caught anything.

-- 
Sam Brauer
Systems Programmer
sam@webslingerZ.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]