in reply to Converting XML to array of array.
for my $id (keys %{ $xml->{book} }) { for my $s (keys %{ $xml->{book}{$id} }) { print "$s: @{ $xml->{book}{$id}{$s} }\n"; } }
Also, don't use XML::Simple.
Here's how to process the XML in XML::XSH2:
open file.xml ; for //book echo (title) edition (edition) by (authors/author/firstname | authors/author/lastname) '(' isbn (isbn) ')' ;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting XML to array of array.
by GotToBTru (Prior) on Jan 23, 2017 at 14:00 UTC |