When you process a directory from the command line, each input file is processed using a new Tranformer, so there is no caching of source documents.
If the lookup files were known statically (doc('lookup.xml')
) then you could force compile-time loading of the document by adding the option --preEvaluateDocFunction:on
. Since the stylesheet is only compiled once, this would have the effect of only loading the lookup document once.
Generally you will have a lot more control over the execution if you run the job from a Java application (using s9api) rather than from the command line.