Subject: | suppress_errors option not honored by load_html() method if set in parser object |
Date: | Thu, 31 Dec 2009 18:38:57 -0800 |
To: | bug-XML-LibXML [...] rt.cpan.org |
From: | Michael Fischer <michael [...] dynamine.net> |
These two code fragments behave differently, though arguably they should
behave identically:
#
# Case 1: Fails - suppress_errors option appears to be ignored
# (but strangely, recover is honored)
#
my $url = "http://finance.yahoo.com";
my $mech = WWW::Mechanize->new();
my $parser = XML::LibXML->new();
$parser->set_option("recover", 1);
$parser->set_option("suppress_errors", 1);
my $dom = $parser->load_html(string => $mech->content());
#
# Case 2: Succeeds - suppress_errors option honored correctly
#
my $url = "http://finance.yahoo.com";
my $mech = WWW::Mechanize->new();
my $parser = XML::LibXML->new();
my $dom = $parser->load_html(string => $mech->content(),
recover => 1,
suppress_errors => 1);
Not sure what's going on here. Must be something in _parse_html_string() ?