I'm using XML::LibXML
to parse a document.
The HTML file behind it, has some minor errors, and the parser reports them:
http://is.gd/create.php?longurl=http://google.com:15: validity error : ID smallink already defined
nal URL was <a href="http://google.com">http://google.com</a><span id="smallink"
^
http://is.gd/create.php?longurl=http://google.com:15: validity error : ID smallink already defined
and use <a href="http://is.gd/fNqtL-">http://is.gd/fNqtL-</a><span id="smallink"
^
However, I disabled error reporting:
my $parser = XML::LibXML->new();
$parser->set_options({ recover => 2,
validation => 0,
suppress_errors => 1,
suppress_warnings => 1,
pedantic_parser => 0,
load_ext_dtd => 0, });
my $doc = $parser->parse_html_file("http://is.gd/create.php?longurl=$url");
My only option to suppress those errors, is to run the script with 2>/dev/null
, which I don't want. Could someone help me please get rid of those errors?