Skip Menu |

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

Report information
The Basics
Id: 235
Status: resolved
Priority: 0/
Queue: XML-XPath

Owner: Nobody in particular
Requestors: chadh [...]

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

Subject: XPath 'sum' fails due to missing to_number method
Download (untitled) / with headers
text/plain 733b
Distribution: XML::XPath-1.12 Perl: 5.6.0 OS: Linux hawking 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown See attached test case. The expected results are: count of BBB is 3 sum of BBB is 22 Under XML::XPath 1.12 (and previous versions, I assume), the actual results are: count of BBB is 3 No such method to_number in XML::XPath::Node::ElementImpl at blib/lib/XML/XPath/ line 360 I added a simple to_number method to my local Patch below: --- XPath/Node/ Wed Mar 7 12:46:40 2001 +++ XPath/Node/ Wed Jan 30 15:28:20 2002 @@ -419,6 +419,10 @@ return $string; } +sub to_number { + return XML::XPath::Number->new(shift->string_value); +} + 1; __END__
Download test-sum
application/octet-stream 406b

Message body not shown because it is not plain text.

From: Roland Moriz
Download (untitled) / with headers
text/plain 447b
this also affects: my $xp = XML::XPath->new(filename => 'config/r2x.xml'); my $nodeset = $xp->find('/config/export/users/user[@status > 0 ]/@id'); ... No such method to_number in XML::XPath::Node::AttributeImpl at /usr/local/lib/perl5/site_perl/5.6.1/XML/XPath/ line 452 I temporarily fixed that by adding the mention fix also to Node/ I also wrote an email to Matt (Author of it) to fix this. thanks, regards, Roland
Download (untitled) / with headers
text/plain 135b
Fixed in CVS. to_number put in (so it'll work for all) and sum() function fixed so it doesn't try and cross sum multiple nodes.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to