KP-10981 rm xml_pp, introduce pretty_print, fix typo
diff --git a/klk2eureco.sh b/klk2eureco.sh
index 7fe0386..16e85ad 100755
--- a/klk2eureco.sh
+++ b/klk2eureco.sh
@@ -100,16 +100,16 @@
mkdir -p $TEI/$SOURCE
t="$TEI/$SOURCE/$BASENAME.$TEIFORMAT.xml"
- echo " generating $t using vrt2tei.pl, and prettifying..."
+ echo " generating $t using vrt2tei.pl..."
perl vrt2tei.pl -t $TEIFORMAT $MASK $x |
- xml_pp | # xml_pp works but takes ages;
gawk -f rearrange-idsDoc.awk > $t # rearranging the start and end tag of idsDoc
- # xmllint- format geht out of memory und --stream machen funktioniert nicht
+ # pretty-printing now done in-process by XML::Twig (pretty_print => 'record'),
+ # replacing the old xml_pp re-parse pass (xmllint --format runs out of memory, --stream can't format)
ls -l $t
# if $t is empty, remove it:
- if [ ! -s $i ]; then
- rm -f $i
+ if [ ! -s $t ]; then
+ rm -f $t
fi
# validating $t:
diff --git a/vrt2tei.pl b/vrt2tei.pl
index 86abb6f..a883a23 100755
--- a/vrt2tei.pl
+++ b/vrt2tei.pl
@@ -48,7 +48,7 @@
use XML::Generator ':pretty'; # apparently no effect when using flush();
-use locale; # diese drei Zeilen, damit \b im regex nicht Umlaute und ß matcht.
+use locale; # diese drei Zeilen, damit \b im regex nicht Umlaute und � matcht.
use POSIX qw(locale_h); # to be able to use setlocale()
#setlocale(LC_ALL,'de_DE');
setlocale(LC_ALL, "fi_FI");
@@ -389,6 +389,7 @@
$twig = new XML::Twig(
keep_spaces => 1, # dadurch auch whitespaces an ehemeligen elementgrenzen im output
keep_atts_order => 1, # requires Tie::IxHash
+ pretty_print => 'record', # one tag per line, needed by rearrange-idsDoc.awk downstream; done here instead of via external xml_pp
comments => 'drop',
start_tag_handlers => {
texts => sub{root(@_, $corpusHeader)}
@@ -574,7 +575,6 @@
} # end sentences
} # end paragraphs
- # $twig->set_pretty_print( 'record');
# $twig->flush($OUT);
$twig->flush("/dev/stdout");
}