Subject: | parse_xml_chunk produce invalid data structure |
ENVIRONMENT:
XML-LibXML 1.58_1
Perl 5.6.1
FreeBSD 4.8-STABLE
libxml2 2.6.15
ERROR DESCRIPTION:
1. parse_xml_chunk produce invalid data structure:
<A/><B/><A/><B/>
instead of expected
<C/><D/><A/><B/>
2. warnings appear during execution:
perl in free(): warning: modified (page-) pointer
The test script is an excerpt from 02parse.t shipped with XML-LibXML 1.58 distribution.
I've tried to execute the script in the same environment using XML-LibXML 1.57 and got the same result. Have not tried with older versions.
This test appeared in XML::LibXML 1.58 test suite.
Sorry, I don't familiar with libxml2/XML-LibXML internals enough to submit a patch.
TEST SCRIPT:
use strict;
use XML::LibXML;
my $sDoc = '<C/><D/>';
my $sChunk = '<A/><B/>';
my $parser = XML::LibXML->new();
my $doc = $parser->parse_xml_chunk( $sDoc, undef );
my $chk = $parser->parse_xml_chunk( $sChunk,undef );
$doc->appendChild( $chk );
print $doc->toString(), "\n";
__END__
SCRIPT OUTPUT:
<A/><B/><A/><B/>
perl in free(): warning: modified (page-) pointer
perl in free(): warning: modified (page-) pointer
perl in free(): warning: modified (page-) pointer
perl in free(): warning: modified (page-) pointer