[Crossposted to the [EMAIL PROTECTED] mail list.]

Kenny,

Thanks a lot for the tip.

I was really rusty with XML::Twig and didn't reread with a lot of
attention the doc.

Anyway, the name of the handler to use is 'StartTagHandlers'.

From the doc:

"you can use the StartTagHandlers option when you create the twig,
which will call a handler when the start tag of the element is found.
The arguments passed to the handler will be the twig and the element.
The element will be empty at that point but the attributes will be
there."
<http://xmltwig.cx/xmltwig/tutorial/yapc_twig_s7.html>

In my code, I only needed to replace TwigHandlers by StartTagHandlers
and it work like a charm.

my $twig = XML::Twig->new(  KeepEncoding => 1,
                            StartTagHandlers => {
                              'folder'  => \&formatfolder,
                              'bookmark'  => \&formatbookmark } );


� (At) 23:52 -0500 28/10/02, Kenny Gatdula �crivait (wrote) :
Emmanuel,
Use start_tag_handlers instead of twig_handler.

Kenny
Cheers
-Emmanuel
--
______________________________________________________________________
Emmanuel D�carie / Programmation pour le Web - Programming for the Web
Frontier - Perl - PHP - Javascript - XML  <http://scriptdigital.com/>

Reply via email to