ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <>
Subject Re: Cached results?
Date Thu, 16 Oct 2008 18:48:23 GMT

On Oct 16, 2008, at 2:26 PM, Dominique Devienne wrote:

> On Thu, Oct 16, 2008 at 1:19 PM, Robert Koberg <> wrote:
>> Ant's XSL only checks the primary XSL file for changes (and the  
>> source XML -
>> not xi:includes or file entities). It does not parse that XSL to find
>> xsl:import/includes to check if they have changed.
>> You could put the import/includes in the primary XSL or use  
>> force=true on
>> the xslt task.
> Or you explicitly check on the included/imported style sheets via
> <uptodate> or AntContrib's <outofdate> separately from <xslt> itself.
> This forces you to put in the build knowledge about the XSL, which is
> not great, but often an acceptable compromise.
> Or you patch <xslt> to parse the XSL to discover it's includes/imports
> (recursively in those too), to check on the timestamps of those as
> well ;-) That's not too difficult, and since they must appear in the
> "prolog" before the templates themselves, you can stop parsing fairly
> early too. But that involves some programming ;-)  --DD

Actually, there is more. You will want to check all document functions  
to see what other  is being used and if it has changed. I actually  
have something like that, but it works off a hierarchical config file  
(something like what apache forrest uses but more recursive in  
orientation) that is not really.

Instead of parsing the XSL, I use 2 custom URIResolvers to gather the  
dependent files and put that into a cache entry object. One resolver  
is set on the factory to resolve import/includes and one is set on the  
transformer to catch all the document() resolves. So at task init the  
factory's cache entry gets checked to see if the actual stylesheet has  
changed. Then for each transform, the relevant entry is checked to see  
if the transform should proceed.

I suppose it could be setup to allow for user URIResolvers as long as  
they implement some yet to be determined interface that extends  

Make sense and/or sound good?

I might have some time in the next few weeks to make it more generic  
for Ant.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message