Posted on 2008-12-25 08:51:55-08 by selvaperumaal
How I can get last child of an element through Twig Handler
Hi, I have trying to get last child of an element using twig object by,
@last_tg=$t->get_xpath(tbody/row[last()]/entry);
its work well, but I need it in twig handler potion as
my $t = new XML::Twig ( twig_handlers => {'tbody/row[last()]/entry' => sub {$_->set_att('aid5:cellstyle'=>'TBL')} );
but it shows error like 'unrecognized expression in handler', is it possible using the 'last()' xpath function here? give me an idea for how I can get last child of an element through Twig Handler. Thanks in advance.
Direct Responses: 9600 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.