Re: [xml-bindings]libxml2 python error messages



* Daniel Veillard:

> On Sun, Sep 22, 2002 at 11:52:44PM +0200, Jean-Baptiste Quenot wrote:
>
> > I'm using intensively  the Python bindings for  libxml2 and libxslt.
> > The major problem I encounter is  that error messages are written to
> > stdout while I'm  running in CGI mode: it breaks  the HTTP response.
> > How could  I suppress output  of errors  in stdout?  I  noticed that
> > changing the
>
>   What  kind of  error message. Can  you chexk  the examples,  you can
> redirrect the error messages to your own handler.

It's okay now.  I had to provide  one also for libxslt to get it working
though.  Is  it normal behaviour?  I  have to register the  callback for
both libraries  to handle  error messages (even  for errors  coming from
libxml2 only).

> > Also, it would  be great to have a  function like saveResultToString
> > in libxslt  because serialize()  is e.g. not  able to  produce angle
> > brackets in text nodes.
>
>   Which is perfectly normal, that's  not possible in XML ! Serializing
> is  saving  the result  to  a  string,  following  the XML  (or  HTML)
> conventions, of course ...

I mean saving the result of the XSL transformation to a string, but IIRC
it  is on  your TODO  list.  BTW,  saveResultToFilename didn't  work for
me.  No file was actually created.  As a workaround, I use the following
code:

    testfile = tempfile.TemporaryFile()
    style.saveResultToFd(testfile.fileno(), result)
    testfile.seek(0)
    content = <read whole file in a string>


> > Any input will be appreciated on the first problem.
>
>   Read the examples ! libxml2/python/tests/error.py

The example did  not import libxslt.  As soon as  you import the libxslt
module, this example fails.

Thanks a lot for your help, and keep up the good work!
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/



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