Skip to content

Commit

Permalink
Merge branch 'main' into data
Browse files Browse the repository at this point in the history
  • Loading branch information
TomazErjavec committed Jun 4, 2024
2 parents 21f2984 + 44e5e76 commit a47bf56
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Scripts/parlamint2teitok.pl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,22 @@
};
};

# add first page begin if missing
my ($firstelem) = @{$xml->findnodes("//text/body/div[1]/*[not(name() = 'gap')]")};
print STDERR $firstelem->toString;
if ($firstelem && ($firstelem->getName() ne 'pb') ) {
my $pb = $xml->createElement("pb");
$pb->setAttribute("n", 0);
$pb->setAttribute("type", "pagination");
$firstelem->parentNode->insertBefore($pb, $firstelem);
}

# add ids page begin if missing
my $pbcnt = 0;
foreach my $pb ( $xml->findnodes("//text//pb[not(\@xml:id)]") ) {
$pbcnt++;
$pb->setAttribute("id", "pb-$pbcnt");
};

} else {
$dcnt = 0; $pbcnt = 0; $scnt = 1;
Expand Down

0 comments on commit a47bf56

Please sign in to comment.