Subject: | local-name() support |
I want to use "local-name()" function in XPath.
Please add HTML::Element->getLocalName().
diff --git a/lib/HTML/TreeBuilder/XPath.pm b/lib/HTML/TreeBuilder/XPath.pm
index a34931e..f94c0c5 100644
--- a/lib/HTML/TreeBuilder/XPath.pm
+++ b/lib/HTML/TreeBuilder/XPath.pm
@@ -131,6 +131,7 @@ sub getParentNode
return $elt->{_parent} || bless { _root => $elt }, 'HTML::TreeBuilder::XPath
}
sub getName { return shift->tag; }
+sub getLocalName { (my $name= $_[0]->tag) =~ s{^.*:}{}; $name; }
sub getNextSibling { my( $elt)= @_;
my $parent= $elt->{_parent} || return undef;
return $parent->_child_as_object( scalar $elt->right,