Subject: | cannot select /.. and /. |
XML::XPath cannot select '/.' and '/..'.
=== t/31dots.t
==================================================================
--- t/31dots.t (revision 7246)
+++ t/31dots.t (revision 7247)
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+use Test::More tests => 3;
+use XML::XPath;
+
+my $xp = XML::XPath->new(ioref => *DATA);
+ok($xp);
+
+my ($root, ) = $xp->findnodes('/.');
+is $root->toString(), '<page />';
+ok not $xp->findnodes('/..');
+
+__END__
+<page></page>
=== XPath/Parser.pm
==================================================================
--- XPath/Parser.pm (revision 7246)
+++ XPath/Parser.pm (revision 7247)
@@ -796,6 +796,9 @@
elsif ($token =~ /^$AXIS_NAME($NCWild|$QName|$QNWild|$NODE_TYPE)$/o) {
return 1;
}
+ elsif ($token =~ /^\.\.?$/) {
+ return 1;
+ }
debug("SUB: '$token' not a step\n");