holli has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; use Data::Dumper; use XML::Twig; my $t= XML::Twig->new ( twig_handlers => { '/foo/bar' => sub { my $bay = $_->get_xpath('bay'); my $baz = $_->get_xpath('baz'); print $bay->att("V"); print $baz->att("V"); } } ); $t->parse(join("", <DATA>)); __DATA__ <foo> <bar> <bay V="A" /> <baz V="B" /> </bar> </foo>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig oddity
by mirod (Canon) on Jan 29, 2007 at 13:48 UTC | |
|
Re: XML::Twig oddity
by convenientstore (Pilgrim) on Nov 15, 2008 at 05:24 UTC | |
by Anonymous Monk on Nov 15, 2008 at 07:10 UTC | |
by convenientstore (Pilgrim) on Nov 15, 2008 at 07:34 UTC | |
by Anonymous Monk on Nov 15, 2008 at 08:23 UTC | |
by convenientstore (Pilgrim) on Nov 15, 2008 at 20:48 UTC |