Skip Menu |

This queue is for tickets about the Class-XPath CPAN distribution.

Report information
The Basics
Id: 13533
Status: new
Priority: 0/
Queue: Class-XPath

People
Owner: Nobody in particular
Requestors: dlt_email-cpan [...] yahoo.com
Cc:
AdminCc:

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



Subject: error messages when searching with xpath attributes
My program did this: @nodes = $t->match("//div[\@id='searchSummary']"); # $t is an Class::XPath instance and produced a lot of errors like this: Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5.8.1/Class/XPath.pm line 206. Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5.8.1/Class/XPath.pm line 206. Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5.8.1/Class/XPath.pm line 206. I fixed it with this: 203a204,205 Show quoted text
> > if(! defined($value) || $value eq "") { next; }
Not all children of the node in question had the attribute I was comparing on, this is what caused the problem. This fix needs to go into the next release of Class::XPath because if I install the new version through CPAN and this same problem crops up I will be quite irate. This was perl 5.8.7 on linux 2.6 with Class-XPath-1.4, but I think this problem would occur across all platforms Thanks