in reply to Creating a hash out of multiple XML attributes in an elment
I think you want something like this:
my $key2value; my $t= XML::Twig->new( twig_handlers => { 'settings' => sub { file( +@_, $key2value); } } ) ->parsefile( 'sample.xml'); sub file{ my($t, $settings, $key2value)=@_; $key2value->{$settings->att( 'key')}= $settings->att( 'value'); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Creating a hash out of multiple XML attributes in an elment
by perlvroom (Acolyte) on Jul 14, 2013 at 21:39 UTC | |
by mirod (Canon) on Jul 15, 2013 at 02:02 UTC | |
by perlvroom (Acolyte) on Jul 15, 2013 at 14:50 UTC | |
by Jenda (Abbot) on Jul 15, 2013 at 15:03 UTC | |
by Anonymous Monk on Jul 14, 2013 at 23:32 UTC |
In Section
Seekers of Perl Wisdom