map two more fields
[star2016] / star2016-abstracts.pl
index bda55b1..1dd239b 100755 (executable)
@@ -7,5 +7,32 @@ use Data::Dump qw(dump);
 my $tpp = XML::TreePP->new();
 my $tree = $tpp->parsefile( "abstracts.xml" );
 
-print dump($tree);
+my $abstracts = delete $tree->{AbstractBook}->{abstract};
 
+warn "# tree = ", dump($tree);
+
+
+my $stat;
+my $id2nr;
+
+my $nr = 0;
+foreach my $abstract ( @$abstracts ) {
+
+       my $id = $abstract->{'Id'} || die "no Id in ",dump($abstract);
+       warn "# $id abstract = ", dump($abstract);
+
+       foreach $k (qw( ContributionType )) {
+               $stat->{$k}->{ $abstract->{$k} } ++;
+       }
+
+       foreach $f (@{ $abstract->{field} } ) {
+               $f->{'-id'} == 1 ?  push @{ $stat->{_symposium}->{ $f->{'#text'} } }, $id :
+               $f->{'-id'} == 2 ?  push @{ $stat->{_theme}->{ $f->{'#text'} } }, $id :
+               "";
+
+               $stat->{field}->{ $f->{'-id'} }++;
+       }
+       $id2nr->{ $id } = $nr++;
+}
+
+warn "# stat = ",dump($stat);