RE: [xsl] document() function caching?

Subject: RE: [xsl] document() function caching?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 31 Jan 2008 18:24:44 -0000
There's a Saxon mailing list which you should really be using for this kind
of question: go to and work from there.

The XSLT specification requires the results of document() to be stable for
the duration of a transformation (which typically means that the results are
likely to be cached for that duration). If you reuse a JAXP Transformer,
then Saxon will hold onto this cache unless you ask otherwise (since the
only reason for reusing a Transformer is to reuse the resources it holds).
If you create a new Transformer for each transformation, which is what I
normally recommend, then I think you will get a clean cache.

Michael Kay 

> -----Original Message-----
> From: Bill French [mailto:bfh@xxxxxxxxxxxxx] 
> Sent: 31 January 2008 17:40
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] document() function caching?
> Hi all,
> We're using Saxon 8 in a servlet hosted within a Tomcat 5.5 
> environment,
>   transforming XML into XHTML via XSLT 2.0.
> We've recently had to integrate our product with a client's 
> web portal. 
> The client uses web services to serve up HTML components, 
> e.g., document headers & footers. The HTML components are 
> dynamically created dependent on the user who's logged in. 
> The rules governing who can see what change quite often.
> We're using the XSLT document function to call the web 
> services. Here's an example:
> <xsl:copy-of
> select="document('http://HOST/webservices/navigation/GetPortal
> Footer')"/>
> A developer on our client's side made changes to the web 
> service but they weren't realized in the application until 
> Tomcat was restarted. So, the question: does Saxon 8 cache 
> results of document() function calls? 
> If so, how would I disable this?
> Thanks in advance for reading/responding.
> Regards
> --Bill

Current Thread