Subject: | base parameter ignored when load_ext_dtd is used |
When I run the following perl script (with dtd file) using XML::LibXML 1.58 or 1.57 a parse error is returned.
We are using
perl, v5.8.7 built for sun4-solaris
perl, v5.6.1 built for sun4-solaris
The same script run using XML::LibXML 1.56 returns OK.
I hope the script is self explanatory on what I am trying todo.
Version 1.58 seems to ignore the 'base' parameter.
The question is... is this a bug or have we been using an undocumented feature?
use File::Spec;
use XML::LibXML;
my $parser = XML::LibXML->new();
$parser->load_ext_dtd(1);
$parser->validation(1);
my $base = File::Spec->catfile( File::Spec->curdir(), 'not_there', 'imaginary.xml' );
my $xml = <<'__MYXML__';
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE foo SYSTEM "../fred.dtd">
<foo>
<bar>1</bar>
</foo>
__MYXML__
my $doc = eval { $parser->parse_string($xml,$base) };
if ( $@ ) {
print "parse error: $@";
}
else {
print "OK\n";
}
with the following DTD file in the same directory as the script and called fred.dtd
<!ELEMENT foo (bar)*>
<!ELEMENT bar (#PCDATA)>