libxml-libxml-perl/t/48_replaceNode_DTD_nodes_rT...

25 lines
409 B
Perl
Raw Permalink Normal View History

2022-09-27 15:00:17 +08:00
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use XML::LibXML;
my $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);
# TEST
ok(1, "Did not crash.");