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 2002/08/23 11:47:39 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization HTMLSerializer.java AbstractTextSerializer.java AbstractSerializer.java

cziegeler    2002/08/23 02:47:39

  Modified:    src/java/org/apache/cocoon/serialization HTMLSerializer.java
                        AbstractTextSerializer.java AbstractSerializer.java
  Log:
  Applying patch for "format properties for Text/XMLSerializer not working" by michael.enke@wincor-nixdorf.com (Michael Enke)
  
  Revision  Changes    Path
  1.8       +16 -16    xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java
  
  Index: HTMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HTMLSerializer.java	4 Jul 2002 09:20:46 -0000	1.7
  +++ HTMLSerializer.java	23 Aug 2002 09:47:39 -0000	1.8
  @@ -53,6 +53,7 @@
   import javax.xml.transform.OutputKeys;
   import javax.xml.transform.sax.TransformerHandler;
   import javax.xml.transform.stream.StreamResult;
  +import java.io.IOException;
   import java.io.OutputStream;
   
   /**
  @@ -62,31 +63,30 @@
   
   public class HTMLSerializer extends AbstractTextSerializer {
   
  -    private TransformerHandler handler;
  -
  +    /**
  +     * Constructor
  +     */
       public HTMLSerializer() {
       }
   
  -    public void setOutputStream(OutputStream out) {
  +    /**
  +     * Set the <code>OutputStream</code> where the requested resource should
  +     * be serialized.
  +     */
  +    public void setOutputStream(OutputStream out) 
  +    throws IOException {
           try {
               super.setOutputStream(out);
  -            handler = this.getTransformerFactory().newTransformerHandler();
  -            format.put(OutputKeys.METHOD,"html");
  +            TransformerHandler handler = this.getTransformerHandler();
  +            this.format.put(OutputKeys.METHOD,"html");
               handler.setResult(new StreamResult(this.output));
  -            handler.getTransformer().setOutputProperties(format);
  +            handler.getTransformer().setOutputProperties(this.format);
               this.setContentHandler(handler);
               this.setLexicalHandler(handler);
           } catch (Exception e) {
  -            getLogger().error("HTMLSerializer.setOutputStream()", e);
  -            throw new RuntimeException(e.toString());
  +            this.getLogger().error("HTMLSerializer.setOutputStream()", e);
  +            throw new IOException(e.toString());
           }
       }
   
  -    /**
  -     * Recyce the serializer. GC instance variables
  -     */
  -    public void recycle() {
  -        super.recycle();
  -        this.handler = null;
  -    }
   }
  
  
  
  1.14      +3 -2      xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
  
  Index: AbstractTextSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractTextSerializer.java	30 Jul 2002 01:49:22 -0000	1.13
  +++ AbstractTextSerializer.java	23 Aug 2002 09:47:39 -0000	1.14
  @@ -186,7 +186,8 @@
       /**
        * Set the <code>OutputStream</code> where the XML should be serialized.
        */
  -    public void setOutputStream(OutputStream out) {
  +    public void setOutputStream(OutputStream out) 
  +    throws IOException {
           /*
            * Add a level of buffering to the output stream. Xalan serializes
            * every character individually. In conjunction with chunked
  
  
  
  1.6       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractSerializer.java
  
  Index: AbstractSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractSerializer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractSerializer.java	22 Feb 2002 07:03:55 -0000	1.5
  +++ AbstractSerializer.java	23 Aug 2002 09:47:39 -0000	1.6
  @@ -51,7 +51,7 @@
   package org.apache.cocoon.serialization;
   
   import org.apache.cocoon.xml.AbstractXMLPipe;
  -
  +import java.io.IOException;
   import java.io.OutputStream;
   
   /**
  @@ -72,7 +72,8 @@
       /**
        * Set the <code>OutputStream</code> where the XML should be serialized.
        */
  -    public void setOutputStream(OutputStream out) {
  +    public void setOutputStream(OutputStream out) 
  +    throws IOException {
           this.output = out;
       }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org