+
+sub calc_bib1 {
+ my($xc) = @_;
+
+ my @bib1nodes = $xc->findnodes('e:indexInfo/e:index/e:map/e:attr[
+ @set = "bib-1" and @type = "1"]');
+ my $nbib1 = @bib1nodes;
+ return "[none]" if $nbib1 == 0;
+
+ my $res = "";
+ my($first, $last);
+ @bib1nodes = sort { $a->findvalue(".") <=> $b->findvalue(".") } @bib1nodes;
+ foreach my $node (@bib1nodes) {
+ my $ap .= $node->findvalue(".");
+ if (!defined $first) {
+ $first = $ap;
+ } elsif (!defined $last || $last == $ap-1) {
+ $last = $ap;
+ } else {
+ # Got a complete range
+ $res .= ", " if $res ne "";
+ $res .= "$first";
+ $res .= "-$last" if defined $last;
+ $first = $ap;
+ $last = undef;
+ }
+ }
+
+ # Leftovers
+ if (defined $first) {
+ $res .= ", " if $res ne "";
+ $res .= "$first";
+ $res .= "-$last" if defined $last;
+ }
+
+ return "$nbib1 access points: $res";
+}
+