cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@locus.apache.org
Subject cvs commit: xml-stylebook/src/org/apache/stylebook/printers HTMLSerializer.java
Date Mon, 03 Jan 2000 16:56:48 GMT
pier        00/01/03 08:56:48

  Added:       src/org/apache/stylebook/printers HTMLSerializer.java
  Log:
  Added new printer to test XML-SERIALIZATION classes.
  
  Revision  Changes    Path
  1.1                  xml-stylebook/src/org/apache/stylebook/printers/HTMLSerializer.java
  
  Index: HTMLSerializer.java
  ===================================================================
  /*****************************************************************************
   * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
   * ------------------------------------------------------------------------- *
   * This software is published under the terms of the Apache Software License *
   * version 1.1,  a copy of wich has been included  with this distribution in *
   * the LICENSE file.                                                         *
   *****************************************************************************/
  package org.apache.stylebook.printers;
  
  import org.apache.stylebook.*;
  import org.apache.xml.serialize.*;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.PrintStream;
  import org.w3c.dom.Document;
  
  /**
   *
   *
   * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
   * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
   *         Software Foundation</a>. All rights reserved.
   * @version CVS $Revision: 1.1 $ $Date: 2000/01/03 16:56:48 $
   */
  public class HTMLSerializer extends AbstractComponent implements Printer {
  
      /**
       * Print a DOM Document.
       *
       * @param doc The Document to print.
       * @param out The OutputStream used for printing.
       * @param env The Environment of this printing request.
       * @exception IOException If an I/O error occourred accessing resources.
       * @exception CreationException If the Document cannot be printed.
       */
      public void print(Document doc, CreationContext c, OutputStream out)
      throws CreationException, IOException {
          OutputFormat f=new OutputFormat(OutputFormat.METHOD_XHTML,
                                          "US-ASCII",true);
          Serializer s=Serializer.makeSerializer(out,f);
          s.serialize(doc);
      }
  }
  
  

Mime
View raw message