in reply to Re^2: Extracting XML data from a tree
in thread Extracting XML data from a tree
Agreed. The story does not look as favorable for XML::Simple anymore if the structure changes. If one makes it more robust using ForceArray => 1, then at least one more loop is required:
my $xml = XMLin( 'CC.xml', ( ForceArray => 1 ) ); for my $day (@{ $xml->{Week}[0]{Day} }) { next unless $day->{'day-of-week'} eq "Tuesday"; for my $time ( @{ $day->{Times}[0]{Time} } ) { print $time->{'start-time'},"\n" if exists $time->{'start-time'}; } }
Not really so "simple" anymore...
|
|---|