Subject: | replaceNode() segfaults when copying DTD nodes with ATTLISTs |
use strict;
use XML::LibXML;
my $xml = <<EOF;
<!DOCTYPE bug>
<bug/>
EOF
$xml = <<EOF;
<!DOCTYPE crash [
<!ATTLIST foo bar CDATA "baz">
]>
<crash/>
EOF
my $src = XML::LibXML->load_xml (string => $xml);
my $dest = XML::LibXML->load_xml (string => $xml);
my $src_dtd = $src->firstChild;
my $dest_dtd = $dest->firstChild;
$dest_dtd->replaceNode($src_dtd);
__END__
Removing the ATTLIST prevents the crash.
Regards,
Guido