#!/usr/bin/perl -w
use strict;
use warnings;
use utf8;
use open qw(:std :utf8);

require $ENV{'ECHO_SCRIPTS_DIR'} . "/share/common_functions.pl";

consoleStatus('Starting conversion from ECHO to TEI');

my $saxon = $ENV{'ECHO_SCRIPTS_DIR'} . "/share/thirdparty/saxonhe9-2-1-1j/saxon9he.jar";
my $stylesheet = $ENV{'ECHO_SCRIPTS_DIR'} . "/share/xslFiles/echo2tei.xsl";

# text input

my $file = shift @ARGV;

my $result = `java -jar $saxon -s:"$file" -xsl:$stylesheet`;
printInOutputTextFile($result);
#print $result;
consoleStatus('Script finished');
