W3C home > Mailing lists > Public > www-xsl-fo@w3.org > March 2001

It doesn´t work

From: Hernandez Ramirez, Marta <mahernandez@opciona.com>
Date: Tue, 13 Mar 2001 13:47:32 +0100
Message-ID: <0B5ADB6872FDD41181600006298FF09B27530C@endmaexc4.endesa.es>
To: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>
I am trying to convert an XML file to PDF file and I use a XSL file.
This is the code I use, does anybody Know why it doesn´t work?


import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

import org.apache.fop.apps.XalanCommandLine;

public class ServletFop extends HttpServlet {
  private static final String CONTENT_TYPE = "text/html";
  /**Inicializar variables globales*/
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
  }
  /**Procesar una petición HTTP Get*/
  public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
  {
    String pepito;
       response.setContentType(CONTENT_TYPE);
          PrintWriter out = response.getWriter();
          out.println("<html>");
          out.println("Pasa1");

      try
    {
 	XalanCommandLine miobjeto;
        String eo[]= new String[3];
        eo[0]="normal.xml";
        eo[1]="normal.xsl";
        eo[2]="normal.pdf";
        miobjeto = new XalanCommandLine(eo);
        miobjeto.run();
    }
    catch(Exception e)
    {
          out.println(e.getMessage());

    }
          out.println("</html>");
  }
  /**Limpiar recursos*/
  public void destroy() {
  }
}
Received on Tuesday, 13 March 2001 07:48:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:08 GMT