You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jan Zmitko <Ja...@t-online.de> on 2003/03/18 22:24:45 UTC

cache piece of FOP Transformation

Hello together,

is it possible to cache pieces of the result from the transformation. I have 
designed my XSL Stylesheet with templates (5 templates). Two Templates 
containes static content and these I would like cache.  My Problem ist that all 
these Stylesheets are called in one Stylesheet and this is transforming.

Thanks for any Ideas.

Best regards, Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: cache piece of FOP Transformation

Posted by Jeremias Maerki <de...@greenmail.ch>.
This is pretty much a question that should be asked elsewhere as it
doesn't relate to FOP. But I think a good XSLT engine will already cache
the static portions nicely if you cache the Templates instance(s)
between XSLT calls.

instead of:
TransformerFactory factory = TransformerFactory.getInstance();
Transformer transformer = factory.newTransformer(new StreamSource(...));

you can do:
TransformerFactory factory = TransformerFactory.getInstance();

//Prepares the stylesheet. This object can be reused.
Templates stylesheet = factory.newTemplates(new StreamSource(...));

//for each XSLT run you do:
Transformer transformer = stylesheet.newTransformer();

Any luck with the advice I sent you on the value objects and SAX event
generation?

On 18.03.2003 22:24:45 Jan Zmitko wrote:
> is it possible to cache pieces of the result from the transformation. I have 
> designed my XSL Stylesheet with templates (5 templates). Two Templates 
> containes static content and these I would like cache.  My Problem ist that all 
> these Stylesheets are called in one Stylesheet and this is transforming.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: cache piece of FOP Transformation

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Jan Zmitko wrote:

> is it possible to cache pieces of the result from the transformation. I have 
> designed my XSL Stylesheet with templates (5 templates). Two Templates 
> containes static content and these I would like cache.  My Problem ist that all 
> these Stylesheets are called in one Stylesheet and this is transforming.

You cannot cache some templates, but you can cache the whole compiled 
stylesheet, take a look at jaxp javax.xml.transform.Templates class.
-- 
Oleg Tkachenko
Multiconn Technologies, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org