[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-xml
Subject:    Re: HTML parser error from XML::LibXML
From:       Benjamin Boksa <benjamin () boksa ! de>
Date:       2004-05-31 20:46:25
Message-ID: 957DC7A8-B343-11D8-81EB-00039310C34C () boksa ! de
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Petr!

> You could try turning warnings off with local $^W=0 or if
> that doesn't help, use brutal force: redirect STDERR to some other
> handle, close it and redirect it back after parsing.

I wondered if there was some other possiblity. A solution like

$parser->warn_on_error(1);

would be much cleaner. After having a short look at LibXML.xs (at  
http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs? 
rev=1.178.2.4&content-type=text/vnd.viewcvs-markup) from the  
XML::LibXML-CVS I see that the warning comes from the method

LibXML_report_error(SV * saved_error, int recover)

I wonder if it would be clean to change the signature to

LibXML_report_error(SV * saved_error, int recover, int warn_on_error)

and do the necessary replacements in the according calls of the  
function. Together with a simple change of LibXML.pm the should allow a  
construct like

$parser->warn_on_error(1);

If you want me to I can try to change LibXML.xs accordingly and send  
you a patch against the current CVS version.

Regards,

Benne
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFAu5mlR5U9XkJXZKwRAtMNAJ9z/1qSR5OOkEnckjIkcF3j7ujqBgCdEvOq
8vGurJiMwK8ql4Fqy531M9g=
=ZRmT
-----END PGP SIGNATURE-----

_______________________________________________
Perl-XML mailing list
Perl-XML@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic