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);