cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Burgess <le...@red-bean.com>
Subject XSLTProcessor patch, etc...
Date Wed, 26 Apr 2000 21:29:11 GMT

I have tried building the latest CVS snapshot of cocoon and found some
difficulty.  Aside from the typo and float conversion errors in
Engine.java, the new engine pooling code breaks cocoon.  I get a
NullPointerException at Engine.getInstance(), so cocoon basically just
dies.  I have looked at the code and cannot figure out what gives.
Just a heads up.

Also, In spite of Mike's suggestion to use XSP for specifying
alternate XSLs in the request, I went into XSLTProcessor.java and
tweaked a couple lines.  The diff is below.  It is rough; but it
works as long as you specify the absolute file path to the XSL you
want to use, rather than the one indicated in the XML:

http://www.myhost.org/test.xml?xsl=/home/lefty/foo.xsl

Mainly, I did this just for kicks and giggles.  However, I think it's
a feature that Cocoon could use.  It seems simpler to me: better to
have 7 (or so) extra lines of code in the application than asking
people to come up with various XSP or Producer implementations.

Can it be (improved and) rolled in?

-- cut here --
Index: XSLTProcessor.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xslt/XSLTProcessor.java,v
retrieving revision 1.11
diff -u -r1.11 XSLTProcessor.java
--- XSLTProcessor.java	2000/04/14 17:15:45	1.11
+++ XSLTProcessor.java	2000/04/26 21:10:29
@@ -170,7 +170,13 @@
             if ((o != null) && (!this.hasChanged(request))) {
                 return (Document) o;
             } else {
-                Document sheet = getDocument(resource);
+	      Document sheet = null;
+	      if (request.getParameter("xsl") != null) {
+		sheet = getDocument(request.getParameter("xsl"));
+	      }
+	      else {
+                sheet = getDocument(resource);
+	      }
                 this.store.hold(resource, sheet);
                 this.monitor.watch(Utils.encode(request), resource);
                 return sheet;
@@ -195,4 +201,4 @@
     public String getStatus() {
         return "XSLT Processor";
     }
-}
\ No newline at end of file
+}
-- cut here --

-- 
Lee P. W. Burgess  <<!>>  The first rule of Lefty is: you do not talk
Programmer         <<!>>  about Lefty.
Red Bean Software  <<!>>  The second rule of Lefty is: YOU DO NOT TALK
lefty@red-bean.com <<!>>  ABOUT LEFTY.






Mime
View raw message