- From: Hernandez Ramirez, Marta <mahernandez@opciona.com>
- Date: Tue, 13 Mar 2001 13:47:32 +0100
- 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 UTC