Skip Menu |

This queue is for tickets about the HTML-TreeBuilder-XPath CPAN distribution.

Report information
The Basics
Id: 61746
Status: open
Priority: 0/
Queue: HTML-TreeBuilder-XPath

People
Owner: Nobody in particular
Requestors: tokuhirom+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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,
On Wed Sep 29 05:55:48 2010, TOKUHIROM wrote: Show quoted text
> I want to use "local-name()" function in XPath. > > Please add HTML::Element->getLocalName().
Good catch. Added in version 0.12, which is on its way to CPAN. The function in HTML::TreeBuilder::XPath is spelled local_name BTW. Thanks for the report and for the fix. __ mirod