cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r161358 - in cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg: JXTemplateGenerator.java TransformerAdapter.java
Date Thu, 14 Apr 2005 22:14:52 GMT
Author: lgawron
Date: Thu Apr 14 15:14:51 2005
New Revision: 161358

URL: http://svn.apache.org/viewcvs?view=rev&rev=161358
Log:
wrap JXTG xmlConsumer with RedundantNamespacesFilter

Modified:
    cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/JXTemplateGenerator.java
    cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/TransformerAdapter.java

Modified: cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/JXTemplateGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/JXTemplateGenerator.java?view=diff&r1=161357&r2=161358
==============================================================================
--- cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/JXTemplateGenerator.java
(original)
+++ cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/JXTemplateGenerator.java
Thu Apr 14 15:14:51 2005
@@ -37,6 +37,7 @@
 import org.apache.cocoon.template.jxtg.script.ScriptManager;
 import org.apache.cocoon.template.jxtg.script.event.Event;
 import org.apache.cocoon.template.jxtg.script.event.StartDocument;
+import org.apache.cocoon.xml.RedundantNamespacesFilter;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.excalibur.source.SourceValidity;
 import org.xml.sax.SAXException;
@@ -86,16 +87,9 @@
         super.recycle();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver,
-     *      java.util.Map, java.lang.String,
-     *      org.apache.avalon.framework.parameters.Parameters)
-     */
     public void setup(SourceResolver resolver, Map objectModel, String src,
-                      Parameters parameters)
-        throws ProcessingException, SAXException, IOException {
+            Parameters parameters) throws ProcessingException, SAXException,
+            IOException {
 
         super.setup(resolver, objectModel, src, parameters);
         if (src != null)
@@ -106,29 +100,22 @@
         this.definitions = new HashMap();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.cocoon.generation.Generator#generate()
-     */
     public void generate() throws IOException, SAXException,
             ProcessingException {
-        performGeneration(this.xmlConsumer, this.startDocument, null);
+        performGeneration(this.startDocument, null);
+
+        // no need to reference compiled script anymore
+        this.startDocument = null;
     }
 
-    public void performGeneration(final XMLConsumer consumer, Event startEvent, Event endEvent)
-            throws SAXException {
-        ((Map)expressionContext.get("cocoon")).put("consumer", consumer);
-        Invoker.execute(this.xmlConsumer, this.expressionContext,
-                        new ExecutionContext(this.definitions, this.scriptManager),
+    public void performGeneration(Event startEvent, Event endEvent) throws SAXException {
+        XMLConsumer consumer = new RedundantNamespacesFilter(this.xmlConsumer); 
+        ((Map) expressionContext.get("cocoon")).put("consumer", consumer);
+        Invoker.execute(consumer, this.expressionContext, 
+                        new ExecutionContext(this.definitions, this.scriptManager), 
                         null, startEvent, null);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.cocoon.caching.CacheableProcessingComponent#getKey()
-     */
     public Serializable getKey() {
         JXTExpression cacheKeyExpr = (JXTExpression) this.startDocument
                 .getTemplateProperty(JXTemplateGenerator.CACHE_KEY);
@@ -144,11 +131,6 @@
         return null;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.cocoon.caching.CacheableProcessingComponent#getValidity()
-     */
     public SourceValidity getValidity() {
         JXTExpression validityExpr = (JXTExpression) this.startDocument
                 .getTemplateProperty(JXTemplateGenerator.VALIDITY);

Modified: cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/TransformerAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/TransformerAdapter.java?view=diff&r1=161357&r2=161358
==============================================================================
--- cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/TransformerAdapter.java
(original)
+++ cocoon/blocks/unsupported/template/trunk/java/org/apache/cocoon/template/jxtg/TransformerAdapter.java
Thu Apr 14 15:14:51 2005
@@ -53,7 +53,7 @@
 
         public void endDocument() throws SAXException {
             super.endDocument();
-            gen.performGeneration(gen.getConsumer(), getStartEvent(), null);
+            gen.performGeneration(getStartEvent(), null);
         }
 
         void setConsumer(XMLConsumer consumer) {



Mime
View raw message