Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 37332
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: martijn [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.66
Fixed in: (no value)



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;
fixed in the SVN, thanks a lot! -- Petr