in reply to Extracting XML data from a tree
#!/usr/bin/perl use strict; use warnings; use XML::Twig; use v5.10; my $twig = XML::Twig->new(); $twig->parsefile( 'CC.xml'); my $looking_for_day = 'Tuesday'; foreach my $node ($twig->get_xpath('//Day[@day_of_week="' . $looking_f +or_day . '"]/Times/Time')) { say $node->att('start-time'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extracting XML data from a tree
by toolic (Bishop) on Jun 04, 2013 at 14:29 UTC | |
by Neighbour (Friar) on Jun 04, 2013 at 14:50 UTC |