--- XPath.pm-bak 2006-12-14 03:30:41.908004600 -0500
+++ XPath.pm 2006-12-14 03:30:41.887975000 -0500
@@ -192,7 +192,7 @@
if ($#nodes < 0) {
if ($node_path =~ m|/@([^/]+)$|) {
# attribute not found, so try to create it
- my $parent_path = $`;
+ my $parent_path = substr($node_path, 0, $-[0]);
my $attr = $1;
$nodeset = $self->findnodes($parent_path);
return undef if (!defined $nodeset); # could not find node