output to stdout; removed paragraph id's, too
diff --git a/vrt2tei.pl b/vrt2tei.pl
index 9ee18b5..67227d2 100755
--- a/vrt2tei.pl
+++ b/vrt2tei.pl
@@ -69,12 +69,9 @@
#----------------------
# arg0 infile: vrt-xml
-# arg1 outfile: tei
-unless($ARGV[1]) {&usage_message()}; # min arg0 und arg1
-if ($ARGV[2]) {&usage_message()}; # max arg1
-
-
+unless($ARGV[0]) {&usage_message()} ; # min arg0, the input file
+if ($ARGV[1]) {&usage_message()}; # max arg0, the input file
####################
@@ -90,11 +87,10 @@
# M A I N
#####################
-
-# open result file and initialise filehandle
-open(my $OUT, "> $ARGV[1]") || die("cannot open file: $ARGV[1]");
-
-
+open(my $IN, "< $ARGV[0]") || die("$0: cannot open file for reading: $ARGV[0]"); # open input file and initialise filehandel, actually does not seem to be needed
+ # as parsefile() (s.b.) is applied to the filename
+## open(my $OUT, "> $ARGV[1]") || die("$0: cannot open file: $ARGV[1]"); # open result file and initialise filehandle
+ # currently not used but flushed to "/dev/stdout"
#-----------------------------------------------------------------------------------
# start twig and call start tag handler for root and twig handler for each <text>
@@ -115,12 +111,13 @@
# dtd_handlers => { # ToDo for I5
# \&set_dtd;
# }
+
output_encoding => $encoding,
);
$twig->parsefile($ARGV[0]);
-close($OUT);
+##TMP close($OUT);
###########
@@ -149,7 +146,7 @@
$root->set_gi('teiCorpus');
$root->set_att("xmlns", 'http://www.tei-c.org/ns/1.0');
- &insertCorpusHeader($root);
+ &insertCorpusHeader($root);
}
@@ -242,7 +239,6 @@
$paragraph->move('last_child', $div_element);
-
#------------------------------
# create <s> from <sentence>
#------------------------------
@@ -270,9 +266,10 @@
} # end sentences
} # end paragraphs
- $twig->flush($OUT);
-} # end texts
-
+ $twig->set_pretty_print( 'record');
+ # $twig->flush($OUT);
+ $twig->flush("/dev/stdout");
+}
sub createTextHeader{
my ($text, $textattsref) = @_;
@@ -487,7 +484,8 @@
$paragraph->set_att("xml:lang", "x-" . $paragraph->att("sum_lang"));
$paragraph->del_att("sum_lang");
- $paragraph->change_att_name('id', 'xml:id');
+ # $paragraph->change_att_name('id', 'xml:id');
+ $paragraph->del_att("id"); # diese id ist auch nicht eindeutig!!
}
sub setS {
my ($sentence) = @_;