1 # special mungle file which prepare data_structure from XML
4 warn "## ds = ",dump( $ds );
9 # check if tag is scalar or array and add it
10 foreach my $tag ( qw/number array/ ) {
11 if ( ref($xml->{$tag}) eq 'ARRAY' ) {
18 warn '## collect data from @a = ',dump( @a ), ' @s = ',dump( @s );
20 # unroll content from arrays
21 foreach my $tag ( @a ) {
22 next unless defined $ds->{xml}->{$tag};
24 map { $_->{content} } @{ $ds->{xml}->{$tag} }
28 # and just copy scalars
29 foreach my $tag ( @s ) {
30 next unless defined $ds->{xml}->{$tag};
31 set_ds( $tag => $ds->{xml}->{$tag} );