Re: [xslt] python xslt messages



On Fri, Apr 12, 2002 at 06:46:13AM -0400, Sam Brauer wrote:
> I've been happily using the Python libxslt interface for a few weeks 
> now, but I have noticed that sometimes there are error messsages written 
> to stderr (for example, when a variable is referred to but was never 
> declared, or when an xpath expression cannot be evaluated).  However no 
> exceptions are thrown and I get a results back from 
> parseStylesheetDoc() and applyStylesheet(), as if everything succeeded.
> 
> Is there some way via Python to access the warning/error messages (other 
> than redirecting stderr) ?

  Have you tried 
    libxml2.registerErrorHandler(your_function, your_context) ?

Generating exceptions would need to build a bit more Python glue around
the existing wrappers to check the error code and raise an exception 
if detected.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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