Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 38399 invoked from network); 16 Oct 2008 18:48:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Oct 2008 18:48:57 -0000 Received: (qmail 62578 invoked by uid 500); 16 Oct 2008 18:48:56 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 61835 invoked by uid 500); 16 Oct 2008 18:48:54 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 61824 invoked by uid 99); 16 Oct 2008 18:48:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Oct 2008 11:48:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.20.54.33] (HELO server2.livestoryboard.com) (69.20.54.33) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Oct 2008 18:47:47 +0000 Received: from [192.168.2.5] (c-24-128-47-98.hsd1.nh.comcast.net [24.128.47.98]) by server2.livestoryboard.com (Postfix) with ESMTP id 237022BEA09 for ; Thu, 16 Oct 2008 14:48:24 -0400 (EDT) Message-Id: <575AB687-5BA3-4D27-ACD4-C1493FA65BBD@koberg.com> From: Robert Koberg To: "Ant Users List" In-Reply-To: <255d8d690810161126kbf51213w390bd0f9233b1a45@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Cached results? Date: Thu, 16 Oct 2008 14:48:23 -0400 References: <48F7833E.8050700@imag.net> <9928A146-85C1-47CD-8E0C-A5C315CA505C@koberg.com> <255d8d690810161126kbf51213w390bd0f9233b1a45@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org 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 > or AntContrib's separately from 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 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 URIResolver. Make sense and/or sound good? I might have some time in the next few weeks to make it more generic for Ant. best, -Rob --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org