You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/09/01 16:04:38 UTC

svn commit: r265735 - in /cocoon/branches/BRANCH_2_1_X: ./ src/java/org/apache/cocoon/serialization/ src/java/org/apache/cocoon/transformation/

Author: cziegeler
Date: Thu Sep  1 07:04:30 2005
New Revision: 265735

URL: http://svn.apache.org/viewcvs?rev=265735&view=rev
Log:
Revert

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?rev=265735&r1=265734&r2=265735&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Thu Sep  1 07:04:30 2005
@@ -90,19 +90,6 @@
     private String cachingKey = "1";
 
     /**
-     * Do we remove all comments?
-     */
-    private boolean removeComments = false;
-
-    /**
-     * If we remove comments, do we keep the document comment?
-     */
-    private boolean keepDocumentComment = true;
-
-    /** Did we get the root element already? */
-    private boolean gotRootElement = false;
-
-    /**
      * Interpose namespace pipe if needed.
      */
     public void setConsumer(XMLConsumer consumer) {
@@ -275,13 +262,6 @@
         } catch (Exception e) {
             getLogger().warn("Cannot know if transformer needs namespaces attributes - assuming NO.", e);
         }
-
-        this.removeComments = conf.getChild("remove-comments").getValueAsBoolean(this.removeComments);
-        this.keepDocumentComment = conf.getChild("keep-document-comment").getValueAsBoolean(this.keepDocumentComment);
-        if ( this.getLogger().isDebugEnabled() ) {
-            this.getLogger().debug("Comment settings: remove comments: " + this.removeComments
-                                 + ", keep document comment: " + this.keepDocumentComment);
-        }
     }
 
     /**
@@ -293,7 +273,6 @@
         if (this.namespacePipe != null) {
             this.namespacePipe.recycle();
         }
-        this.gotRootElement = false;
     }
 
     /**
@@ -583,24 +562,6 @@
         //       } catch (IOException ignored) {
         //       }
         //   }
-    }
-
-    /**
-     * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
-     */
-    public void comment(char[] ch, int start, int len) throws SAXException {
-        if ( !this.removeComments
-             || (!this.gotRootElement && this.keepDocumentComment)) {
-            super.comment(ch, start, len);
-        }
-    }
-
-    /**
-     * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-     */
-    public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException {
-        this.gotRootElement = true;
-        super.startElement(uri, loc, raw, a);
     }
 
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java?rev=265735&r1=265734&r2=265735&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java Thu Sep  1 07:04:30 2005
@@ -22,7 +22,6 @@
 
 import org.xml.sax.SAXException;
 import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
 
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.sax.TransformerHandler;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java?rev=265735&r1=265734&r2=265735&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java Thu Sep  1 07:04:30 2005
@@ -628,8 +628,7 @@
      */
     public void startDocument() throws SAXException {
         this.filter = new MyFilter(this.xmlConsumer,
-                                   this, 
-                                   this.parameters.getParameterAsBoolean("remove-comments", false));
+                                   this);
         super.startDocument();
     }
 
@@ -684,18 +683,14 @@
 
     private final CIncludeTransformer transformer;
 
-    private final boolean removeComments;
-
     /**
      * This filter class post-processes the parallel fetching
      * @param consumer
      */
     public MyFilter(XMLConsumer consumer,
-                    CIncludeTransformer transformer,
-                    boolean removeComments) {
+                    CIncludeTransformer transformer) {
         super(consumer);
         this.transformer = transformer;
-        this.removeComments = removeComments;
     }
 
     /**
@@ -732,15 +727,6 @@
             }
         } else {
             super.startElement(uri, local, qName, attr);
-        }
-    }
-
-    /**
-     * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
-     */
-    public void comment(char[] ary, int start, int length) throws SAXException {
-        if ( !this.removeComments ) {
-            super.comment(ary, start, length);
         }
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=265735&r1=265734&r2=265735&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Sep  1 07:04:30 2005
@@ -216,9 +216,6 @@
     <action dev="CZ" type="add">
       Portal block: Add WSRP consumer support (through WSRP4J).
     </action>
-    <action dev="CZ" type="add">
-      Add possibility to remove comments to all text based serializers and to cinclude transformer.
-    </action>
     <action dev="AG" type="update">
       Updated hsqldb to 1.8.0.2.
     </action>