You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@locus.apache.org on 2000/11/15 18:17:40 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/components/language/markup LogicsheetCodeGenerator.java

dims        00/11/15 09:17:40

  Modified:    src/org/apache/cocoon/components/language/markup Tag:
                        xml-cocoon2 LogicsheetCodeGenerator.java
  Log:
  Cleaning up. Remove dependency on Xalan's serialize package.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.9   +14 -11    xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/LogicsheetCodeGenerator.java
  
  Index: LogicsheetCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/LogicsheetCodeGenerator.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- LogicsheetCodeGenerator.java	2000/11/14 21:52:05	1.1.2.8
  +++ LogicsheetCodeGenerator.java	2000/11/15 17:17:39	1.1.2.9
  @@ -17,11 +17,12 @@
   
   import java.io.IOException;
   
  -import org.apache.xalan.serialize.SerializerFactory;
  -import org.apache.xalan.serialize.Method;
  -import org.apache.xalan.serialize.Serializer;
  -import org.apache.xalan.serialize.OutputFormat;
  +import org.apache.xml.serialize.SerializerFactory;
  +import org.apache.xml.serialize.Method;
  +import org.apache.xml.serialize.Serializer;
  +import org.apache.xml.serialize.OutputFormat;
   
  +
   import javax.xml.transform.sax.TransformerHandler;
   import javax.xml.transform.sax.SAXResult;
   import javax.xml.transform.TransformerException;
  @@ -31,7 +32,7 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/11/14 21:52:05 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/11/15 17:17:39 $
    */
   public class LogicsheetCodeGenerator implements MarkupCodeGenerator {
   
  @@ -45,6 +46,8 @@
   
       private TransformerHandler currentParent;
   
  +    private StringWriter writer;
  +
       /**
       * The default constructor
       */
  @@ -52,16 +55,16 @@
           // set the serializer which would act as ContentHandler for the last transformer
           // FIXME (SSA) change a home made content handler, that extract the PCDATA
           // from the last remaining element
  -        this.serializer = SerializerFactory.getSerializer(Method.Text);
  +        SerializerFactory factory = SerializerFactory.getSerializerFactory(Method.TEXT);
           OutputFormat outformat = new OutputFormat();
           // FIXME (SSA) set the right encoding set
           //outformat.setEncoding("");
           // FIXME (SSA) remove the nice identing. For debug purpose only.
  -        outformat.setIndent(true);
  +        outformat.setIndent(4);
           outformat.setPreserveSpace(true);
  -        this.serializer.setOutputFormat(outformat);
  -
  -        this.serializer.setWriter(new StringWriter());
  +        this.serializer = factory.makeSerializer(outformat);
  +        this.writer = new StringWriter();
  +        this.serializer.setOutputCharStream(writer);
           try {
               this.serializerContentHandler = this.serializer.asContentHandler();
           } catch (IOException ioe) {
  @@ -115,7 +118,7 @@
           this.rootReader = reader;
           // start the parsing
           this.rootReader.parse(input);
  -        return this.serializer.getWriter().toString();
  +        return this.writer.toString();
       }
   
   }