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 93392 invoked from network); 14 Feb 2000 20:30:33 -0000 Received: from unknown (HELO host2.altacast.com) (63.84.216.2) by locus.apache.org with SMTP; 14 Feb 2000 20:30:33 -0000 Received: from EXCHANGE by host2.altacast.com via smtpd (for locus.apache.org [63.211.145.10]) with SMTP; 14 Feb 2000 20:30:33 UT Received: by firewall.altacast.com with Internet Mail Service (5.5.2448.0) id <1Y31ZHD1>; Mon, 14 Feb 2000 13:30:33 -0700 Message-ID: <85CDFD92C550D311A1A40008C7DFA81A01D63A@firewall.altacast.com> From: "Timm, Sean" To: "'cocoon-dev@xml.apache.org'" Subject: [PATCH] XSLT processor fixed to properly reload stylesheets if ch anged Date: Mon, 14 Feb 2000 13:30:27 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" 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() {