xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pedro Barco Bernal" <pba...@ceh.junta-andalucia.es>
Subject ERROR in server
Date Wed, 06 Feb 2002 07:53:57 GMT
Hi all!

    My question is very simple, i want to create a pdf file from a xml file
and a xsl file.
    My code is placed in a JSP and i do not know why it doesn´t run fine.
    The error i get is: "org.apache.fop.apps.FOPException: Bad file
descriptor" but i´m sure that the xml and xsl are well-formed...
    Please, if you know the solution to my problem, answer my question.

This is my code:
     * xmlparam,xslparam,pdfparam are the routes of the files placed in my
server-->/u01/oracle/..../xml.xml, xsl.xsl,
    File xmlf = new File(xmlparam);
    File xslf = new File(xslparam);
    File writefile = new File(pdfparam);
    Driver driver = new Driver();
    InputHandler inputHandler = new XSLTInputHandler(xmlf, xslf);
    XMLReader parser = inputHandler.getParser();
    InputSource inputSource = inputHandler.getInputSource();
    driver.setOutputStream(new FileOutputStream(writefile));
    driver.render(parser, inputSource);

This is my xml (named xml.xml)


This is my xsl (named xsl.xsl)

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"

<xsl:output method="xml" media-type="text/xml"
<xsl:template match="timesheet">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:simple-page-master master-name="only">
<fo:page-sequence master-name="only">
<fo:flow flow-name="xsl-region-body">

<xsl:template match="employee">
<fo:block font-size="8pt" font-family="arial"
<xsl:apply-templates select="first_name"/>
<xsl:apply-templates select="last_name"/>
<xsl:apply-templates select="dept"/>
<xsl:apply-templates select="location"/>
<xsl:apply-templates select="ext"/>
<xsl:apply-templates select="type"/>

<xsl:template match="first_name">
<xsl:value-of select="."/>

<xsl:template match="last_name">
<xsl:value-of select="."/>

<xsl:template match="dept">
<xsl:value-of select="."/>

<xsl:template match="location">
<xsl:value-of select="."/>

<xsl:template match="ext">
<xsl:value-of select="."/>

<xsl:template match="type">
<xsl:value-of select="."/>


View raw message