Subject: | xpath root selector return twig object, not root element |
The get_xpath code returns the containing XML::Twig object instead of
the root XML::Twig::Elt element for '/'.
This also causes xpath expressions like '/gi[1]' to die with "Can't
locate object method "child" via package "XML::Twig" at (eval 13) line 1."
Subject: | xpath-root-selector.patch |
--- Twig.pm 2006-04-19 19:00:43.000000000 +0200
+++ Twig.pm.mod 2006-04-19 19:03:15.000000000 +0200
@@ -5597,7 +5597,7 @@
# grab the root if expression starts with a /
if( $xpath_exp=~ s{^/}{})
- { $sub .= '@results= ($elt->twig);'; }
+ { $sub .= '@results= ($elt->root);'; }
elsif( $xpath_exp=~ s{^\./}{})
{ $sub .= '@results= ($elt);'; }
else