tags:

views:

225

answers:

1

I have an xsl:fo style sheet that refers to a URL which is an image. Throughout my code, I change the jpg file that the URL points to. I then wish to use the xsl to create a pdf, and want it to include whichever file is currently at the URL. However, XSL caches the images, such that once a PDF is created, and the image is changed, the next time the PDF is created it uses the old image.

  1. Clearly the best solution would be to clear the xsl cache. However, I only have access to the xslt file itself, is there an xsl/xml command to clear the image cache?
  2. My second solution involved time stamping the jpg when I create it. If I put the jpg in it's own directory, then I'd have to read that directory and just get the one and only file in it, and use that in the xsl. However, I'm a novice xsl user and don't know how to read directories.

The first solution is clearly the more elegant one, but I don't know how to do either.

Any ideas????

Thanks

A: 

I don't know what language/library you are using, but in my case, using Java and Apache FOP, I finally found that I need to call FopImageFactory.resetCache(); (this is for FOP 0.20, the API has changed since). Just for the sake of it, in case someone else in the same situation loses some time looking for a solution :)