Print

Print


On 27/12/12 01:58, Sebastian Rahtz wrote:
> On 24 Dec 2012, at 21:29, Eberhard von Kitzing <[log in to unmask]> wrote:
>
>> The TEI consortium suggests to use ant script files to perform the various XSL transformation.
>
> this may give the wrong impression; we have a set of ant scripts which
> exemplify use of the XSL, but this is by no means the only way. OxGarage, for
> example, does not use them
>
>> For the transformation of single files respective ant scripts are offered. For some projects it might be helpful to have a script which would convert any file in a folder or its subfolders when running a script. Often it would be even better if only those source files would be converted which are newer than there respective target files.
>>
>
> I do agree, this is an excellent idea, to support multiple files on those transforms. I tend to do
> shell-level
>     for i in *.xml; do teitoXXX $i;done
> but of course this is rather inefficient, as it starts a new JVM for each file

Another problem with this is that it regenerates all files, not just 
those files for which the generated file is old than the source file. 
You should be able to do:

for file in *.xml; do
   if  [ "${filename%.*}.html" ot "$file" ]
   then
     echo $file out of date, regenerating
     teitohtml $i
   else
     echo $file current, no need to regenerate
   fi
done

Note that this still starts a new JVM.

cheers
stuart