Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 72017 invoked from network); 15 Feb 2000 17:35:24 -0000 Received: from unknown (HELO host2.altacast.com) (63.84.216.2) by locus.apache.org with SMTP; 15 Feb 2000 17:35:24 -0000 Received: from EXCHANGE by host2.altacast.com via smtpd (for locus.apache.org [63.211.145.10]) with SMTP; 15 Feb 2000 17:35:24 UT Received: by firewall.altacast.com with Internet Mail Service (5.5.2448.0) id <1055PRFP>; Tue, 15 Feb 2000 10:35:24 -0700 Message-ID: <85CDFD92C550D311A1A40008C7DFA81A01D63B@firewall.altacast.com> From: "Timm, Sean" To: "'cocoon-dev@xml.apache.org'" Subject: FW: [PATCH] XSLT processor fixed to properly reload stylesheets i f changed Date: Tue, 15 Feb 2000 10:35:23 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" I'm sending this once again because I once again didn't receive this even though it's in the archive. Did anyone receive the original message? The mailing lists have seemed kind of flaky to me lately... - Sean T. -----Original Message----- From: Timm, Sean Sent: Monday, February 14, 2000 1:30 PM To: 'cocoon-dev@xml.apache.org' Subject: [PATCH] XSLT processor fixed to properly reload stylesheets if changed I figured out the problem I was seeing with XSLT stylesheets being cached off even though they had changed. We are dynamically determining the stylesheet to display for a specific URL based on various factors, but the XSLT processor was only looking at the request object to determine if the resource had changed. In our case, the requested resource was the same, but the XSL filename was different. I modified the processor to tack on the name of the XSL processor to the lookup key. The changes are as follows: Index: XSLTProcessor.java =================================================================== RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xslt/XSLTProcesso r.java,v retrieving revision 1.6 diff -u -r1.6 XSLTProcessor.java --- XSLTProcessor.java 2000/02/13 18:29:34 1.6 +++ XSLTProcessor.java 2000/02/14 20:25:35 @@ -158,11 +158,11 @@ try { Document sheet; - - if (this.hasChanged(request)) { + String stylesheetKey = Utils.encode(request, true) + resource.toString(); + if (this.hasChanged(stylesheetKey)) { sheet = getDocument(resource); this.store.hold(resource, sheet); - this.monitor.watch(Utils.encode(request, true), resource); + this.monitor.watch(stylesheetKey, resource); } else { Object o = this.store.get(resource); if (o != null) { @@ -170,6 +170,7 @@ } else { sheet = getDocument(resource); this.store.hold(resource, sheet); + this.monitor.watch(stylesheetKey, resource); } } @@ -198,7 +199,7 @@ } public boolean hasChanged(Object context) { - return this.monitor.hasChanged(Utils.encode((HttpServletRequest) context, true)); + return this.monitor.hasChanged((String)context); } public String getStatus() {