libxml: handling parse errors

M

Mage

Hello,

I found the libxml API very nice, so I started using it.

When I try to open a non-well-formed xml, two things happen:
- errors are displayed on screen (stderr)
- exception raises

Well, I would like to catch the error messages instead of displaying
them. After reading the documentation, all my ideas faded away (except
hacking stderr which is not I want to do).

Could you help please?

Mage
 
R

Ross Bamford

I found the libxml API very nice, so I started using it.

When I try to open a non-well-formed xml, two things happen:
- errors are displayed on screen (stderr)
- exception raises

Well, I would like to catch the error messages instead of displaying
them. After reading the documentation, all my ideas faded away (except
hacking stderr which is not I want to do).

We have a (contributed) patch that addresses this (allows an error proc
to be used) that will certainly make the next libxml-ruby release. I
won't post it here since it's yet to be merged with the new code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top