[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

libxml: handling parse errors

Mage

3/17/2006 1:20:00 PM

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


1 Answer

Ross Bamford

3/17/2006 2:01:00 PM

0

On Fri, 2006-03-17 at 22:20 +0900, Mage wrote:
>
> 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.

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk