HTML in a FOP

Hi - I have a field coming from the database which has HTML tags in it. When I try to display the field using FOP, it doesn't display anything but instead throws an error
Unsupported element encountered: html<fo:block>some html tags </fo:block>Not sure how to display the HTML. Can somebody please point me in the right direction.
Thanks !

FOP cannot work with HTML. It can only work with XSLFO.
Some of the resource for XSLFO are:
http://www.w3schools.com/xslfo/default.asp
http://www.w3c.org/Style/XSL/
http://www.antennahouse.com/XSLsample/XSLsample.htm
You will need to transform your HTML in XSLFO. The way this can be done is
1> Cleanup your html using Tidy
2> Write an XSL to transform the resulting to XSLFO
3> Render the resulting XSLFO to PDF, PS, etc using FOP

Similar Messages

  • How to print from HTMLDB Report

    Hello
    How to print a report developped in HTMLDB report page ?

    Hello Patrick
    Thank you for the suggestion.
    Is there any idea to tailore the MSExcel pattern so
    that it does not permit final user to change the
    report content.Have you looked into using FOP to create PDFs?
    Here are a couple URLs:
    tech note
    http://www.oracle.com/technology/pub/notes/technote_htmldb_fop.html
    installation thread
    FOP installation
    Earl

  • DOM HTML - FOP

    Hello, I'm not new to Java, but new to using DOM Documents and FOP.
    Here is my case:
    I have to make the following object / method:
    - Take in a stream of HTML (String or whatever).
    - Process and output a PDF of that HTML.
    I know I know, FOP is suited to transforming XML / XSL to PDF, but in my very specific case, it has to be HTML to PDF.
    So here is what I tried:
    - Make a new HTMLDocumentImpl.
    - Open it.
    - htmlDoc.write(myHtmlString).
    - Close it.
    It doesn't work, it is as if the write() method simply refuses to empty out its buffer inside the HTMLDocumentImpl and parse it into the DOM Document structure. (The buffer IS filled with my html, but when I close, it doesn't write it in...)
    I tried something else:
    - Make a DOMParser.
    - Set the parser's property "...document-class-name" to HTMLDocumentImpl.
    - Create InputSource with the StringReader.
    - parser.parse(InputSource).
    - parser.getDocument.
    The resulting HTMLDocument seemed to be ok (in the debugger view the html properties were set inside). However, when I send this Document to a Driver set to output PDF and tell the Driver to render(htmlDocument), I get an error saying that Unsupported Element Encountered: null and goes on saying it expected an XSL-FO element...
    I have been searching all day for information on how FOP handles HTMLDocuments or something like that and haven't been able to find anything.
    Could anyone help me by either telling me what I'm doing wrong, or by telling me of a quick and easy way to do HTML -> PDF...
    Thanks everyone!

    One easy way:
    You have XHTML.
    It suffices to write a XSL stylesheet, use XALAN to
    transform the XHTML into xsl-fo (according to your
    XSL), and then use FOP to create the PDF from xsl-fo.Here is a simple example:
    use the fop scripts (fop.sh or fop.bat) to transform the following into PDF with e.g../fop.sh -xml test.html -xsl test.xsl -pdf test.pdffile test.html<?xml version="1.0" encoding="utf-8"?>
    <html>
    <body>
    A
    simple
    example.
    </body>
    </html>Note the xml declaration in line 1.
    file test.xsl<?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:fo="http://www.w3.org/1999/XSL/Format"
                    version="1.0">
      <xsl:output method="xml" indent="yes"/>
      <xsl:template match="/">
          <fo:root>
              <fo:layout-master-set>
                  <fo:simple-page-master master-name="regular"
                                         page-height="29.7cm"
                                         page-width="21cm"
                                         margin-top="1cm"
                                         margin-bottom="1.5cm"
                                         margin-left="2.5cm"
                                         margin-right="2.5cm">
                      <fo:region-body margin-top="1cm"
                                      margin-bottom="1.5cm"/>
                      <fo:region-before extent="1cm"/>
                      <fo:region-after extent="0.5cm"/>
                  </fo:simple-page-master>
              </fo:layout-master-set>
              <xsl:apply-templates select="html"/>
          </fo:root>
      </xsl:template>
      <xsl:template match="html">
        <fo:page-sequence master-reference="regular"
                          initial-page-number="1">
          <fo:flow flow-name="xsl-region-body">
             <xsl:apply-templates select="body"/>
          </fo:flow>
        </fo:page-sequence>
      </xsl:template>
      <xsl:template match="body">
        <fo:block>
        <xsl:apply-templates/>
        </fo:block>
      </xsl:template>
      <xsl:template match="br">
        <fo:inline linefeed-treatment="preserve"
                   wrap-option="no-wrap"
                   white-space-collapse="false"
                   white-space-treatment="preserve"><xsl:text disable-output-escaping="yes">
    </xsl:text></fo:inline>
      </xsl:template>
    </xsl:stylesheet>Yes, it is rather time-consuming to write those stylesheets :-(

  • Printing XLS, HTML, or RTF using Apache FOP

    Hi,
    Is it possible to print XLS, HTML, or RTF reports using Apache FOP? If not, is there another open source or free print server that will do this?
    Thank you.
    Martin

    Hello,
    >>
    Your going to want to study the Cocoon sitemap concept to see how to pipeline the xml and xsl to the right output.
    >>
    To get this working correctly you need to understand the Cocoon sitemap concept and how to read data out of the XML file your posting in order to pipeline it to the right rendering format. It's pretty much a hands on affair so it depends on what your trying to do, sorry there is no easier way to do it.
    In a future versions it will be easier to do this as you will be able to select specific end points per report.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Trouble in fop(convert html 2 pdf) source.

    to convert html 2 pdf file I found the article from javaworld.
    (http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html)
    unfortunately I can't seem to find the two classes below even though import all fop 0.94 library files.
    are there something I'm missing?
    Thanks.
    import org.apache.fop.apps.Driver;
    import org.apache.fop.tools.DocumentInputSource;

    Much thanks for your timely reply.  The scanner software requires that one must scan to an application.  The configuration has to point to an executable.  In program files I must select an executable,  in this case acrobat.exe.   Have been using this for years and never have seen a problem.  Continues guidance sought.

  • Generate PDF with FOP : Specific charactar are wrong

    Hello,
    I've finally tested FOP to convert HTML to PDF. It's GREAT.
    I have just a little problem, german specific characters are shown well under html,
    but not under PDF. Any idea about this issue ?

    Hello,
    I've finally tested FOP to convert HTML to PDF. It's GREAT.
    I have just a little problem, german specific characters are shown well under html,
    but not under PDF. Any idea about this issue ?

  • Error while configuring apache FOP for printing

    Dear All,
    I have a requirement to print a report using custom layout.
    I have installed apex 4.2 by configuring embedded PL/SQL gateway. I used the link:
    http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/overview.htm#CJABBFIH
    And for printing purpose I am installing apache FOP. I have installed oc4j in standalone mode. I followed the link:
    http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html
    But after setting oc4jadmin password, I am getting following error
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    I am not well versed with java.
    Can anyone please throw light on this issue and help me resolve this problem. This is an urgent requirement.
    Thanks and regards,
    Deepika.

    Deepika R wrote:
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    Seems like the Java EE container is looking for the Java compiler. Try installing the Java Development Kit (JDK) and respecify your JAVA_HOME accordingly. HTH.

  • Re: More control over html tags needed

    I have trying for a while to find an elegant solution to printing reports in such a way as to have headers and footers repeated on every printed page.
    <BR><BR><BR>
    The two main solutions seem to be either using PDF (using FOP) or controlling the size of the regions anually (by hardcoding heights etc.). I am confident that with more control over the html tags (or the ability to place my own) around certain areas the problem could be solved very simply with CSS.
    <BR><BR><BR>
    What I would like is a way to change the way that Apex treats table headers.
    <BR><BR><BR>
    Presently it places the headers within a tbody tag and the uses th for every column. Ideally I would like to see this changes from tbody to thead. Given that the chances of this happening in the near future are minimal (not something that I am upset about as it would not be logical to change such things every time someone wants things to suite them better), I would like to be able to place a tag either before or after the tbody tag.
    <BR><BR><BR>
    Something like:
    <BR><BR><BR>
    div id="tableheaders"
    <BR><BR><BR>
    If anyone knows how to do this your help will be greatly appreciated. Given that, printing repeated headings can be controlled relatively simply.

    Hello Andrew,
    I believe the following might be of help - placing <thead> and </thead> around headers
    Regards,
    Arie.

  • JasperReportIntegration tool - Report coming back as HTML instead of PDF

    Using:
    * Apex 4.1.1 (using EPG)
    * 11G SE
    * Apache FOP as print Server
    * Dietmar Aust's free tool on integrating JasperReports
    I've recently created a second APEX instance locally (from externally hosted instance) and copied the application (via application export) and parsing schema (using exp/imp). Everything works fine except when I try to print reports (for JasperReports) it comes up as garbled HTML instead of PDF.
    In my hosted instance it all works fine.
    Since the necessary packages to integrate with Jasper reports goes into the parsing schema for application, all necessary objects are imported as well during the exp/imp.
    The only thing different about the hosted and my local instance is that the hosted one is XE where as my local one is SE but I don't think this is a factor at all.
    The other difference is the hosted instance uses Apex Listener while mine doesn't. Again don't think this a factor as well.
    My print server is enabled and working and I can print tables as PDF reports.
    I am not sure if I need to enable something or missed a step needed so the reports come up as expected as is the case in hosted instance. Any hints or suggestions welcome.
    Cheers.

    Hi Dietmar, I couldn't do it as I couldn't find that line I needed to modify. The XLIB_HTTP package goes upto line 45 and those lines referred in that post goes upto 89,90.
    But then I was due to change from EPG to Web Server + Apex Listener (for other reasons) which in turn solved my issue anyway.
    create or replace PACKAGE "XLIB_HTTP"
    AS
    /*=========================================================================
      $Id: xlib_http.pks 21 2010-01-07 07:41:27Z dietmar.aust $
      Purpose  : Make http callouts
      License  : Copyright (c) 2010 Dietmar Aust (opal-consulting.de)
                 Licensed under a BSD style license (license.txt)
                 http://www.opal-consulting.de/pls/apex/f?p=20090928:14
      $LastChangedDate: 2010-01-07 08:41:27 +0100 (Thu, 07 Jan 2010) $
      $LastChangedBy: dietmar.aust $
    Date        Author           Comment
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    19.02.2007  D. Aust          initial creation
    07.08.2008  D. Aust          added check_get_request
                                  display_url_raw: pass all request headers
                                     to the client
    =========================================================================*/
       c_success   CONSTANT CHAR (1) := '1';
       c_fail      CONSTANT CHAR (1) := '0';
       PROCEDURE display_url_raw (
          p_url                       VARCHAR2,
          p_mime_type_override   IN   VARCHAR2 DEFAULT NULL,
          p_charset              IN   VARCHAR2 DEFAULT NULL
       PROCEDURE retrieve_blob_from_url (
          p_url               VARCHAR2,
          o_blob        OUT   BLOB,
          o_mime_type   OUT   VARCHAR2
       FUNCTION escape_form_data (s VARCHAR2)
          RETURN VARCHAR2;
       FUNCTION check_get_request (p_url VARCHAR2)
          RETURN CHAR;
    END;Edited by: Arc_x on 11-Sep-2012 21:17

  • Issue in PDF printing using FOP

    We have configured Print server as per http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html section #5
    However when we try to print pdf, it says "Page Cannot be found"
    In the print server oc4j log, here is what we see:
    =============
    08/11/18 09:58:03 [ERROR] Logger not set
    08/11/18 09:58:03 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    08/11/18 09:58:03 [INFO] building formatting object tree
    08/11/18 09:58:03 [INFO] setting up fonts
    08/11/18 09:58:03 [INFO] [1]
    08/11/18 09:58:03 [WARNING] table-layout=auto is not supported, using fixed!
    08/11/18 09:58:03 [INFO] area contents overflows area in line Solicitation
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Proposal
    08/11/18 09:58:03 [INFO] area contents overflows area in line Proposal
    08/11/18 09:58:03 [INFO] area contents overflows area in line Project
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Created
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Project
    08/11/18 09:58:03 [INFO] area contents overflows area in line ETECH
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Request
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Stephen
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line Serena
    08/11/18 09:58:03 [INFO] area contents overflows area in line
    08/11/18 09:58:03 [INFO] area contents overflows area in line assessment
    08/11/18 09:58:03 [INFO] area contents overflows area in line station
    08/11/18 09:58:03 [INFO] area contents overflows area in line Fillmore,
    08/11/18 09:58:03 [INFO] area contents overflows area in line Fillmore,
    08/11/18 09:58:03 [INFO] area contents overflows area in line Fillmore
    08/11/18 09:58:03 [INFO] area contents overflows area in line Fillmore
    08/11/18 09:58:03 [INFO] area contents overflows area in line Buffalo,
    08/11/18 09:58:03 [INFO] Parsing of document complete, stopping renderer
    ===============
    Is there any setting that we are missing.Any help will be appreciated.

    Mary
    I too use multiple report queries which are then converted to XML and passed to the FOP server, I'm not sure what you want is achievable in the report queries. Alternatively you can use XSL in the style sheet to conditionally display output.
    e.g.
    <fo:block font-size="8pt">
    <xsl:for-each select="//ROWSET2/ROWSET2_ROW">
    <xsl:variable name="vContactTypeName">
    <xsl:value-of select="CONTACT_TYPE_NAME"/>
    </xsl:variable>
    <xsl:if test="$vContactTypeName = 'URL'">
    <fo:block><xsl:value-of select="CONTACT_TYPE_VALUE"/></fo:block>
    </xsl:if>
    </xsl:for-each>
    </fo:block>
    Hope that helps
    Paul

  • Apache FOP not displaying Cyrillic properly

    Hi,
    I am using apache FOP to generate pdfs' in Russian. I have embedded the fonts into the application but the output is being displayed as html numerical codes.
    The html numerical codes are stored in the database but I am unable to render them properly. I know the fonts are embedded correctly because when I apply the fonts to English text, Russian characters are displayed in the pdf correctly.
    e.g the Russian characters are displayed like this:
    &#1087;&#1088;&#1086;&#1076;... etc
    Why are my codes not displaying properly ? I'm a bit lost at this point.
    thanks in advance

    Hi,
    thanks for the reply.
    To clarify things a bit. My web page is submitting Russian text which is being stored in an Oracle database. This text is being stored in the &#xxxx; format. This formatting is displayed properly in a web browser but I am using Apache FOP to produce a pdf and the Russian text is not being displayed as the Russian characters but as the relative &#xxxx; codes. So these codes are not being translated back into their Russian Cyrillic symbols.
    I have configured FOP and embedded the Cyrillic TTF but these codes are still not displayed. I can apply the Cyrillic font style to English text and Russian characters are displayed so it seems that that cyrillic TTF is embedded properly.
    I am not generating an serialized xml file but rather creating a javax.xml.transform.dom.DOMSource object and with my xsl file I create the pdf code snippet below:
    thanks
    Paul
              //Setup a buffer to obtain the content length
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              // add fonts for Russian and Chinese certificates
              String fontConfig = path + "fonts/fontcfg.xml";
           FopFactory fopFactory = FopFactory.newInstance();
           fopFactory.setUserConfig(fontConfig);
           FOUserAgent foAgent = fopFactory.newFOUserAgent();
              //Setup FOP
              Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,foAgent , out);
              //Setup Transformer
              Source xsltSrc = new StreamSource(new File(xslFile));
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer(xsltSrc);
              //Make sure the XSL transformation's result is piped through to FOP
              Result res = new SAXResult(fop.getDefaultHandler());
              //Setup input
              Source domSrc = new DOMSource(xmlDom);         
           //Start the transformation and rendering process
              transformer.transform(domSrc, res);
              //Prepare response
              response.setContentType("application/pdf");
              response.setContentLength(out.size());
              //Send content to Browser
              response.getOutputStream().write(out.toByteArray());
              response.getOutputStream().flush();

  • XSL-1009: (Error) Attribute 'version' not found in 'HTML'

    Hi,
    I've got the following problem: oracle.xml.parserv2.XSLException
    <Line 1, Column 7>: XSL-1009: (Error) Attribute '{http://www.w3.org/1999/XSL/Transform}:version' not found in 'HTML'.
    and I wanted to know what are its origins and what to do to go around, knowing that:
    - we run a java application on an oracle 9iAS and it works fine !
    - we run the same application on an oracle web-to-go server and it gives this message on the client when trying to put
    - the mobile server 'java environment' is a little bit never (version) than the online environment, both servers (9ias an mobile) run on the same machine (mobile is never -> impact on client environment? Installs run under jre 1.3.01)
    - we have an xml document (DOM) and an .fo stylesheet (file/url), so no html for output! Where comes it from? The <xsl:output method="html"> has even been removed and tried with method="application/pdf", no change.
    - the function XSLProcessor.newXSLStylesheet raises this exception; to make it at least run on online environment, we used the .jar file from JDevelopper 9.0.2.822 (this .jar is used in JDev, on 9ias and mobile client)
    - the output file (via apache's fop) shows correctly in the online version, but fails the create/use of the stylesheet (tried stylesheet with xml data for output and a generique 'Hello World' .fo for pdf output, both fail)
    - the .fo starts with <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    - we even tried xsl:version="1.0" and no version at all
    - the same XML parsed with an .xsl for html output works fine, in mobile, the attribute "http://www.w3.org/1999/XSL/Transform" does not show up as an error
    I guess we have a version or configuration conflict, but what exactly could it be? If you need some more version numbers, just let me know.
    Thanx very much for any help!

    Hi,
    as I wrote in the inital message, we even left out the output method or used "application/pdf". The result is unfortunately always the same. And I still claim this is not a problem with the stylesheet itself, it has to do something with the mobile's environment.
    Something I didn't tell: we have 2 servlets in our application, 1 responsible for output in html and 1 in pdf. The .fo stylesheet passed to the 'html servlet' is parsed correctly (and shows the source code, because it does not know about fo and conversion to pdf), the .xsl stylesheet passed to the 'pdf servlet' raises same exception/same line. You might tell us that there is a problem with the 'pdf servlet', but once again: why in online it is working?
    Greetings and thanx very much for your precious time!

  • APEX 4.1 - APACHE FOP PDF generation problem.

    Hi all,
    I'm having problem with PDF generation using APACH FOP on OC4J.
    When I test my print server as described here:
    http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
    everything works without problem. But when I upload my Layout to APEX and try to generate PDF from apex I'm getting error:
    oracle.xml.parser.v2.XMLParseException: Unexpected EOF.
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
         at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:549)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1375)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:362)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:308)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:337)
         at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:714)
         at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:322)
         at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
         at apex_fop._jspService(_apex__fop.java:71)
         [SRC:/apex_fop.jsp:21]
    I could see similar post here:
    Handling Special characters in call to apex_util.download_print_document
    But it doesn't explain my case as it's crashing even when I generate empty pdf(no data so no special characters, only empty XML file with no data should be sent to print server)
    Is there any way to see what xml is sent do print server for processing? That could eventually show where is a problem.
    Palo

    My mistake, there was really an "&" character in my template. now when I replaced it with %26 it works.
    However I would be still interested if there is a way to see what data is APEX engine sending to print server cause it will help me to find this kind of errors.
    Palo

  • How to generate HTML from XML and XSL?

    Hi all,
    I am new to XML.
    Can I somehow see the HTML-Output of the XML-File, when I have the XSL-File too, but don't use any XML-Editor (XMLSpy) and FOP? I do not want use any additional tools - only the database tools.
    What I need for this?
    Do I need the XSLT-File too?
    I am waiting for your answers, when possible with examples please.
    Regards
    Leonid Pavlov

    Please post on the General XML forum.

  • Writing FOP output to BLOB

    Hi Experts !
    i am using Apache FOP to generate PDF from xml. I am able to generate PDF file from the xml by using fol code :-
    public void convertXML2PDF(File xmlfile, File xsltfile, File pdffile)
    throws IOException, TransformerException {
         //OutputStream pdfout = null;
         try {
    // configure fopFactory as desired
    FopFactory fopFactory = FopFactory.newInstance();
    FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
    // configure foUserAgent as desired
    // Setup output
    OutputStream out = new java.io.FileOutputStream(pdffile);
    out = new java.io.BufferedOutputStream(out);
    try {
    // Construct fop with desired output format
    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
    // Setup XSLT
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xsltfile));
    // Set the value of a <param> in the stylesheet
    transformer.setParameter("versionParam", "2.0");
    // Setup input for XSLT transformation
    Source src = new StreamSource(xmlfile);
    // Resulting SAX events (the generated FO) must be piped through to FOP
    Result res = new SAXResult(fop.getDefaultHandler());
    // Start XSLT transformation and FOP processing
    transformer.transform(src, res);
    } finally {
    out.close();
    System.out.println("Success!");
    } catch (Exception e) {
    e.printStackTrace(System.err);
    System.exit(-1);
    this code writes the output to a file on disk. I am required to write the output to BLOB as File IO is not an option. Can someone please help me out in directing the outputstream to BLOB with no file IO.
    Best Regards !

    Use PreparedStatement.setBlob(int, java.io.InputStream) (with a PipedInputStream/PipedOutputStream pair if you can't get an InputStream from FOP?).
    http://download.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html#setBlob(int,%20java.io.InputStream)

Maybe you are looking for