in reply to Struggling with XML
Hello.
With XML::Twig, maybe something like this. Twig has nice tutorial.
use strict;use warnings; use XML::Twig; my $t=XML::Twig->new( twig_roots => { '/root/dict[@key="data"]/list/dict' => sub { my ($twig,$elt)=@_; printf "%s = %s\n", $elt->att("key"), $elt->first_child_te +xt; }, }, )->parsefile('your.xml');
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Struggling with XML
by agentorange (Sexton) on Oct 05, 2012 at 13:28 UTC |
In Section
Seekers of Perl Wisdom