I think that you want to cache Templates objects, not Transformers. The Templates object is a representation of your stylesheet and is thread-safe. You can create a Transformer object from a Templates object in a fairly lightweight operation. Transformer objects can be serially reused but are not thread-safe so you'd need to implement some kind of pooling if you wanted to reuse the Transformer objects.
The xsl:include elements should all be resolved at the time that you create the Templates object so you shouldn't need to reference those elements at transform time. Depending on how you're crafting your solution, you may want to use a custom URIResolver that looked things up in your HashMap. I'd have a look at the URIResolver interface and the Transformer.setURIResolver method. HTH, Gary -----Original Message----- From: Agn�s BOURLON [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 9:23 AM To: [EMAIL PROTECTED] Subject: XSL Cache with <xsl:include Hi, I would like to know if it's possible to manage an XSL Cache with Xalan and which is the best solution. First, I wanted to keep in a HashMap all the XSL files content (to avoid to read it from the hard disk every time) But with the <xsl:include ..> directive in the XSL files, Xalan Transformer can't find the included files because it searchs them in the variable "user.dir"... (a solution can be : copy the included files contents within the xsl file "mother" , before put it in the cache) And now, I wonder if it's possible to keep a Transformer Object (associated with an XSL content) instead of the XSL File content. I'm afraid about the consequences when a great number of threads will want to use the same Transformer to generate the HTML with different XML file. Any idea would be welcome. Thinks in advance, Agnes
