Subject: | Error in parsing predicate-expression |
While the following oneliner prints a corect result
C:\TEMP>perl -MXML::XPath -e "my $xp=XML::XPath->new(xml=>'<a/>'); for (-3..3) {print $xp->find(qq{//*[$_=2]})->size()}"
0000010
changing the sign of 2 (or replacing 2 by 0) reveals a bug:
C:\TEMP>perl -MXML::XPath -e "my $xp=XML::XPath->new(xml=>'<a/>'); for (-3..3) {print $xp->find(qq{//*[$_=-2]})->size()}"
1111000
C:\TEMP>perl -MXML::XPath -e "my $xp=XML::XPath->new(xml=>'<a/>'); for (-3..3) {print $xp->find(qq{//*[0=$_]})->size()}"
1111000
I would expected '0100000' and '0001000' as the result, respectively
(that is also the result of XMLSpy 4.4 and WebSphere Studio 4.02).
Relevant Modules: XML::XPath 1.12, XML::Parser 2.29
Perl-Version: 5.005_03 for MSWin32-x86-object (ActivePerl build 522)