Subject: | .dtd:1: parser error : Content error in the external subset |
When parsing an NZB file, the referenced DTD is loaded despite being told to not load them:
my $xml = XML::LibXML->new();
$xml->load_ext_dtd(0);
$xml->load_xml(IO => \*FILE);
=========
http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd:1: parser error : Content error in the external subset
<html>
^
The error is the same with load_ext_dtd(1):
my $xml = XML::LibXML->new();
$xml->load_ext_dtd(1);
$xml->load_xml(IO => \*SUBJECTFILE);
=========
http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd:1: parser error : Content error in the external subset
<html>
^
The problem goes away, however, if you use an undocumented libxml feature:
my $xml = XML::LibXML->new();
$xml->load_xml(IO => \*SUBJECTFILE, load_ext_dtd => 0);
I say undocumented, as the documentation states, "LibXML options are global [...] They can either be set using $parser->option(...), or XML::LibXML->option(...)," and "$parser->load_ext_dtd(1);".
Subject: | spam-test.nzb |
Message body not shown because it is not plain text.