Subject: | Fails to find camelCase attribute names |
attached is a diff that demonstrates that XML::XPathEngine cannot find
camelcase attribute names, like "a[@fooBar]".
Subject: | camelcase.diff |
--- 01_basic.t 2012-11-30 14:22:35.000000000 +0000
+++ /tmp/01_basic.t 2011-10-14 13:35:31.000000000 +0000
@@ -25,26 +25,23 @@
my $kid_nodes= $xp->findvalue( '/root/kid0', $tree);
is( $kid_nodes, 'vkid2vkid4', q{findvalue( '/root/kid0', $tree)});
}
-
{
-my @nodes= $xp->findnodes( '//*[@fooBar]', $tree);
-is( scalar @nodes, 1, q{findnodes( '//*[@fooBar]', $tree)});
is( $xp->findvalue( '//*[@att2="vv"]', $tree), 'gvkid1gvkid2gvkid3gvkid4gvkid5',
q{findvalue( '//*[@att2="vv"]', $tree)}
);
-is( $xp->findvalue( '//*[@att2]', $tree), 'gvkid1gkid2 1gkid3 1gvkid2gkid2 2gkid3 2gvkid3gkid2 3gkid3 3gvkid4gkid2 4gkid3 4gvkid5gkid2 5gkid3 5',
+is( $xp->findvalue( '//*[@att2]', $tree), 'gvkid1gkid2 1gvkid2gkid2 2gvkid3gkid2 3gvkid4gkid2 4gvkid5gkid2 5',
q{findvalue( '//*[@att2]', $tree)}
);
}
is( $xp->findvalue( '//kid1[@att1=~/v[345]/]', $tree), 'vkid3vkid5', "match on attributes");
-is( $xp->findvalue( '//@*', $tree), 'i1v1i2v1i3vvi4vx1i5val1i6v2i7vvi8vx0i9val0i10v3i11vvi12vx1i13val1i14v4i15vvi16vx0i17val0i18v5i19vvi20vx1i21val1i22', 'match all attributes');
-is( $xp->findvalue( '//@*[parent::*/@att1=~/v[345]/]', $tree), 'v3i11v4i15v5i19', 'match all attributes with a test');
+is( $xp->findvalue( '//@*', $tree), 'i1v1i2v1i3vvi4vx1i5v2i6vvi7vx0i8v3i9vvi10vx1i11v4i12vvi13vx0i14v5i15vvi16vx1i17', 'match all attributes');
+is( $xp->findvalue( '//@*[parent::*/@att1=~/v[345]/]', $tree), 'v3i9v4i12v5i15', 'match all attributes with a test');
is( $xp->findvalue( '//kid1[@att1="v3"]/following::gkid2[1]', $tree), 'gkid2 4', "following axis[1]");
is( $xp->findvalue( '//kid1[@att1="v3"]/following::gkid2[2]', $tree), 'gkid2 5', "following axis[2]");
-is( $xp->findvalue( '//kid1[@att1="v3"]/following::kid1/*', $tree), 'gvkid5gkid2 5gkid3 5', "following axis");
+is( $xp->findvalue( '//kid1[@att1="v3"]/following::kid1/*', $tree), 'gvkid5gkid2 5', "following axis");
is( $xp->findvalue( '//kid1[@att1="v3"]/preceding::gkid2[1]', $tree), 'gkid2 2', "preceding axis[1]");
is( $xp->findvalue( '//kid1[@att1="v3"]/preceding::gkid2[2]', $tree), 'gkid2 1', "preceding axis[1]");
is( $xp->findvalue( '//kid1[@att1="v3"]/preceding::gkid2', $tree), 'gkid2 1gkid2 2', "preceding axis");
@@ -74,7 +71,7 @@
is( $xp->findvalue( 'substring-after((id("i2")//*[1])/@att2, "v")', $tree), 'v', 'substring-after(id())');
is( join( '|', $xp->findvalues( '//kid1[@att1=~/v[345]/]', $tree)), 'vkid3|vkid5', "findvalues match on attributes");
-is( join( '|', $xp->findvalues( '//kid1[@att1=~/v[345]/]/@id', $tree)), 'i11|i19', "findvalues on attributes");
+is( join( '|', $xp->findvalues( '//kid1[@att1=~/v[345]/]/@id', $tree)), 'i9|i15', "findvalues on attributes");
is( $xp->findvalue( '2', $tree), 2, 'findvalues on a litteral');
is( $xp->findvalue( '//gkid1="gvkid1"', $tree), 1, 'findvalues on a litteral');
@@ -102,8 +99,6 @@
$gkid1->add_as_last_child_of( $kid);
my $gkid2= tree->new( 'att', name => 'gkid2', value => "gkid2 $_", att2 => "vx", att3 => $_ % 2, id => "i" . ++$id);
$gkid2->add_as_last_child_of( $kid);
- my $gkid3= tree->new( 'att', name => 'fooBar', value => "gkid3 $_", att2 => "val", att3 => $_ % 2, id => "i" . ++$id);
- $gkid3->add_as_last_child_of( $kid);
}
$tree->set_pos;