Re: [xml] Redirecting error output with python bindings



On Tuesday 01 February 2005 04:15, Frans Englich wrote:
Hello,

I have trouble redirecting the error output from libxml2, via the Python
bindings.

I tried the validate.py[1] example, but it does what I expect it to _not_
do: it prints to standard out. After testing a bit, it looks like the
noerr() is never called.

What I want to achieve is to retrieve the error as a string. What am I
doing wrong? is the noerr function called in the example? What is the
proper way to do what I want to?

I've attached two files: validity.py and invalid.xml, as per the example on 
xmlsoft.org. When I run it, I get an error message to standard out, which I 
do not expect. Do you get the same result, and do I have the right 
expectation? This is with Python 2.4 and libxml2 2.6.16 Any documentation 
which could get me on the right track in this matter?


Cheers,

                Frans

Attachment: invalid.xml
Description: Text Data

Attachment: validity.py
Description: application/python



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