cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/formatter HTMLFormatter.java TextFormatter.java VRMLFormatter.java WMLFormatter.java XMLFormatter.java
Date Thu, 06 Jan 2000 17:57:52 GMT
stefano     00/01/06 09:57:52

  Modified:    src/org/apache/cocoon/formatter HTMLFormatter.java
                        TextFormatter.java VRMLFormatter.java
                        WMLFormatter.java XMLFormatter.java
  Log:
  make it work with latest Xerces
  
  Revision  Changes    Path
  1.3       +11 -5     xml-cocoon/src/org/apache/cocoon/formatter/HTMLFormatter.java
  
  Index: HTMLFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/formatter/HTMLFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HTMLFormatter.java	2000/01/03 01:46:51	1.2
  +++ HTMLFormatter.java	2000/01/06 17:57:50	1.3
  @@ -1,4 +1,4 @@
  -/*-- $Id: HTMLFormatter.java,v 1.2 2000/01/03 01:46:51 stefano Exp $ -- 
  +/*-- $Id: HTMLFormatter.java,v 1.3 2000/01/06 17:57:50 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -58,20 +58,26 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.2 $ $Date: 2000/01/03 01:46:51 $
  + * @version $Revision: 1.3 $ $Date: 2000/01/06 17:57:50 $
    */
   
   public class HTMLFormatter extends AbstractFormatter implements Status {
   
  +    private SerializerFactory factory;
  +        
  +    public HTMLFormatter () {
  +        this.factory = SerializerFactory.getSerializerFactory(Method.HTML);
  +    }
  +
       public void format(Document document, Writer writer, Dictionary p) throws Exception
{
           OutputFormat format = super.getFormat(p);
  -        format.setMethod(OutputFormat.METHOD_HTML);
  +        format.setMethod(Method.HTML);
           format.setOmitXMLDeclaration(true);
           format.setPreserveSpace(true);
           format.setDoctype("-//W3C//DTD HTML 4.0//EN", "http://www.w3.org/TR/REC-html40/strict.dtd");
           format.setVersion("4.0");
  -        Serializer serializer = Serializer.makeSerializer(writer, format);
  -        serializer.serialize(document);
  +        Serializer serializer = factory.makeSerializer(writer, format);
  +        serializer.asDOMSerializer().serialize(document);
       }
   
       public String getMIMEType() {
  
  
  
  1.3       +11 -5     xml-cocoon/src/org/apache/cocoon/formatter/TextFormatter.java
  
  Index: TextFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/formatter/TextFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TextFormatter.java	2000/01/03 01:46:51	1.2
  +++ TextFormatter.java	2000/01/06 17:57:50	1.3
  @@ -1,4 +1,4 @@
  -/*-- $Id: TextFormatter.java,v 1.2 2000/01/03 01:46:51 stefano Exp $ -- 
  +/*-- $Id: TextFormatter.java,v 1.3 2000/01/06 17:57:50 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -58,18 +58,24 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.2 $ $Date: 2000/01/03 01:46:51 $
  + * @version $Revision: 1.3 $ $Date: 2000/01/06 17:57:50 $
    */
   
   public class TextFormatter extends AbstractFormatter implements Status {
   
  +    private SerializerFactory factory;
  +        
  +    public TextFormatter () {
  +        this.factory = SerializerFactory.getSerializerFactory(Method.TEXT);
  +    }
  +
       public void format(Document document, Writer writer, Dictionary p) throws Exception
{
           OutputFormat format = super.getFormat(p);
  -        format.setMethod(OutputFormat.METHOD_TEXT);
  +        format.setMethod(Method.TEXT);
           format.setOmitXMLDeclaration(true);
           format.setPreserveSpace(true);
  -        Serializer serializer = Serializer.makeSerializer(writer, format);
  -        serializer.serialize(document);
  +        Serializer serializer = this.factory.makeSerializer(writer, format);
  +        serializer.asDOMSerializer().serialize(document);
       }
   
       public String getMIMEType() {
  
  
  
  1.4       +2 -3      xml-cocoon/src/org/apache/cocoon/formatter/VRMLFormatter.java
  
  Index: VRMLFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/formatter/VRMLFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VRMLFormatter.java	2000/01/03 01:46:51	1.3
  +++ VRMLFormatter.java	2000/01/06 17:57:50	1.4
  @@ -1,4 +1,4 @@
  -/*-- $Id: VRMLFormatter.java,v 1.3 2000/01/03 01:46:51 stefano Exp $ --
  +/*-- $Id: VRMLFormatter.java,v 1.4 2000/01/06 17:57:50 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -54,12 +54,11 @@
   import java.io.*;
   import java.util.*;
   import org.w3c.dom.*;
  -import org.apache.xml.serialize.*;
   import org.apache.cocoon.framework.*;
   
   /**
    * @author <a href="mailto:jmbirchfield@proteus-technologies.com">James Birchfield</a>
  - * @version $Revision: 1.3 $ $Date: 2000/01/03 01:46:51 $
  + * @version $Revision: 1.4 $ $Date: 2000/01/06 17:57:50 $
    */
   
   public class VRMLFormatter extends AbstractFormatter implements Status {
  
  
  
  1.4       +11 -5     xml-cocoon/src/org/apache/cocoon/formatter/WMLFormatter.java
  
  Index: WMLFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/formatter/WMLFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WMLFormatter.java	2000/01/03 01:46:51	1.3
  +++ WMLFormatter.java	2000/01/06 17:57:50	1.4
  @@ -1,4 +1,4 @@
  -/*-- $Id: WMLFormatter.java,v 1.3 2000/01/03 01:46:51 stefano Exp $ -- 
  +/*-- $Id: WMLFormatter.java,v 1.4 2000/01/06 17:57:50 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -59,19 +59,25 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.3 $ $Date: 2000/01/03 01:46:51 $
  + * @version $Revision: 1.4 $ $Date: 2000/01/06 17:57:50 $
    */
   
   public class WMLFormatter extends AbstractFormatter implements Status {
   
  +    private SerializerFactory factory;
  +        
  +    public WMLFormatter () {
  +        this.factory = SerializerFactory.getSerializerFactory(Method.XML);
  +    }
  +
       public void format(Document document, Writer writer, Dictionary p) throws Exception
{
           OutputFormat format = super.getFormat(p);
  -        format.setMethod(OutputFormat.METHOD_XML);
  +        format.setMethod(Method.XML);
           format.setOmitXMLDeclaration(false);
           format.setPreserveSpace(false);
           format.setDoctype("-//WAPFORUM//DTD WML 1.1//EN", "http://www.wapforum.org/DTD/wml_1.1.xml");
  -        Serializer serializer = Serializer.makeSerializer(writer, format);
  -        serializer.serialize(document);
  +        Serializer serializer = this.factory.makeSerializer(writer, format);
  +        serializer.asDOMSerializer().serialize(document);
       }
       
       public String getMIMEType() {
  
  
  
  1.3       +11 -5     xml-cocoon/src/org/apache/cocoon/formatter/XMLFormatter.java
  
  Index: XMLFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/formatter/XMLFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLFormatter.java	2000/01/03 01:46:51	1.2
  +++ XMLFormatter.java	2000/01/06 17:57:51	1.3
  @@ -1,4 +1,4 @@
  -/*-- $Id: XMLFormatter.java,v 1.2 2000/01/03 01:46:51 stefano Exp $ -- 
  +/*-- $Id: XMLFormatter.java,v 1.3 2000/01/06 17:57:51 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -58,19 +58,25 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.2 $ $Date: 2000/01/03 01:46:51 $
  + * @version $Revision: 1.3 $ $Date: 2000/01/06 17:57:51 $
    */
   
   public class XMLFormatter extends AbstractFormatter implements Status {
   
  +    private SerializerFactory factory;
  +        
  +    public XMLFormatter () {
  +        this.factory = SerializerFactory.getSerializerFactory(Method.XML);
  +    }
  +
       public void format(Document document, Writer writer, Dictionary p) throws Exception
{
           OutputFormat format = super.getFormat(p);
  -        format.setMethod(OutputFormat.METHOD_XML);
  +        format.setMethod(Method.XML);
           format.setOmitXMLDeclaration(false);
           format.setPreserveSpace(true);
           format.setVersion("1.0");
  -        Serializer serializer = Serializer.makeSerializer(writer, format);
  -        serializer.serialize(document);
  +        Serializer serializer = this.factory.makeSerializer(writer, format);
  +        serializer.asDOMSerializer().serialize(document);
       }
   
       public String getMIMEType() {
  
  
  

Mime
View raw message