Hallo David,

thank you for your response!

Your hint clearly states the message of
http://xml.apache.org/xalan-j/usagepatterns.html#multithreading:

"A Transformer, on the other hand, is a lightweight object that tracks
state information during
the transformation, and should only be used to perform a single
transformation.


If you want to perform multiple transformations (sequentially or
concurrently) with the same stylesheet instructions,


do the following:



   1.      Use the TransformerFactory newTemplates(Source xslSource) method
     to create a Templates object.

   2.      For each transformation, use the Templates object newTransformer
     () method to create a Transformer,
     and use that Transformer's transform(Source xmlSource, Result
     transformResult) method to perform the
     transformation."

So I followed your and the quoted advice and used the class Templates as a
runtime representation
of the stylesheet.

The application now nearly reaches the old performance.

Perhaps one point could be mentioned.

The class Examples in the samples has a method "exampleTransformerReuse".
This method reuses a transformer that is build by the statement:

     Transformer transformer = tfactory.newTransformer(new
StreamSource(xslID));

Perhaps a comment to this method could underline the point that even if one
executes
the multiple transformations all in only one thread, as it does our
application, it is
not recommended to use this method 'tfactory.newTransformer' in a
productive
environment with many reusing transformations.

And it would be great if the NullpointerException that is thrown did have a
stacktrace or
a message one could search with ...

Greetings

Andreas


---------------------------------------------------------------------------

Andreas Rulle

Intermoves AG
Technologiepark 19
33100 Paderborn

Tel.  + 49 (0) 52 51 1613-0
* Fax  + 49 (0) 52 51 1613-99
* mailto:[EMAIL PROTECTED]

Reply via email to