Re: libxml2 python error messages
[email protected] Mon, 23 Sep 2002 13:32:50 +0200
| Newsgroups | gmane.comp.gnome.lib.xml.bindings |
|---|---|
| Message-ID | <20020923113250.GD19413@www> |
On Mon, Sep 23, 2002 at 12:55:57PM +0200, Jean-Baptiste Quenot wrote: > * 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. You need to save the result of an XSL transformation to a python string? There _is_ a function 'saveResultToString' in the libxslt python bindings (at least there _should_ be, i've written one and AFAIK Daniel applied the patches. There should be even a small sample/testcase in $LIBXSLT/python/tests/basic.py). Ralf Mattes