Subject: | segfault using XPathContext on nodes without a document |
See the attached script. I'm using 1.66 and libxml2 2.6.32.dfsg-2 (the
debian unstable package)
Subject: | foo.pl |
use XML::LibXML;
use XML::LibXML::XPathContext;
my $xpc = XML::LibXML::XPathContext->new;
my $frag = XML::LibXML::DocumentFragment->new;
my $foo = XML::LibXML::Element->new('foo');
$frag->appendChild($foo);
$foo->appendTextChild('bar', 'quux');
warn $frag->toString;
# this works
#if (my $list = $xpc->findnodes('./foo', $frag)) {
# this doesn't
#if (my $list = $xpc->findnodes('./foo/bar', $frag)) {
# nor does this
if (my $list = $xpc->findnodes('./bar', $foo)) {
foreach my $node (@$list) {
warn $node->toString;
}
warn $frag->toString;
}
warn $frag->toString;