Can anybody tell what version of Xalan is safe to reuse transformer object (I'm not using transformer parameters)? I've been reusing transfomer objects for a while and didn't know I cold have a potential problem here. I guess I should have checked documentation first.
Vlad To: scott_boag <[EMAIL PROTECTED]>, Christopher Giblin <[EMAIL PROTECTED]> cc: cgi <[EMAIL PROTECTED]>, xalan-j-users <[EMAIL PROTECTED]> Subject: RE: Reuse of transformers Scott: This is good news. So with latest version of Xalan, I could reuse the "transformer" object as opposed to underlying "templates". Need to test this out. Also, do we need to update the http://xml.apache.org/xalan-j/usagepatterns.html#multithreading ?? --Naren -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 08, 2002 5:43 AM To: Christopher Giblin Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Reuse of transformers The statement about not reusing them sequentially is incorrect. When a given transformation finishes it calls a reset() method on itself. This is supposed to be highly tested, and should work OK. There were some bugs fixed with resetting of parameters in the case in the last released version. -scott "Christopher Giblin" To: [EMAIL PROTECTED] <[EMAIL PROTECTED] cc: [EMAIL PROTECTED], (bcc: Scott Boag/Cambridge/IBM) om> Subject: Reuse of transformers 03/08/2002 03:42 AM Hi The JAXP spec suggests to me that Transformers can be reused at will, threading considerations aside. Xalan trax examples even demonstrate this. Yet the Xalan "Usage Patterns" page, under the title "Multithreading", states: "A Transformer ... 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: ... 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." Multithreading is not a consideration for me but performance is very much so. I am tweeking and need to apply the same transformation possibly hundreds of times. If I can reuse the same transformer, great. I am now skeptical due to the above statements, however. Is Xalan recommending a "Best Practice" by endorsing new Transform instance for each transformation? Or did I misread the JAXP spec? Thanks, chris
