I am trying to run a FopServlet and I get this exception in my browser when
I try to render the .FO file:
org.xml.sax.SAXParseException: The root element is required in a well-formed
document
I know you think its the .FO file but I even get it when I run the readme.fo
that comes with FOP through it.
Here is what the code looks like:
    FileInputStream foFile = new
FileInputStream(request.getParameter(FO_REQUEST_PARAM));
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.setContentType("application/pdf");
    Driver driver = new Driver(foFile, out);
    driver.run();
    byte[] content = out.toByteArray();
    response.setContentLength(content.length);
    response.getOutputStream().write(content);
    response.getOutputStream().flush();

Is there some Driver setting I should be doing?
TIA,

Erich Kilmer
Bell+Howell

PS: My .fo file starts out like this:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <fo:layout-master-set>
                <fo:simple-page-master margin-right=".5in"
margin-left=".5in" margin-bottom="0in" margin-top=".25in"
master-name="right">
                        <fo:region-body margin-bottom="0in"/>
                        <fo:region-after extent="0in"/>
I can send the entire file if someone wants to look at it.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to