to parse the xml:

 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document XMLDoc = db.parse(source);
        System.out.println("file gevonden");
        prop.put(targetKey, XMLDoc);

to parse the xsl:
 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                    DocumentBuilder db = dbf.newDocumentBuilder();
                    inFile =  new File((String)initprops.get(key));
                    Document XSLDoc = db.parse(inFile);
                    TransformDocs.put(key, XSLDoc);

to transfer the xsl :
           transForm = transFactory.newTransformer(new DOMSource
((Node)TransformDocs.get(((String)props.get(languageKey)) + "_XSL")));
            res = new DOMResult();
            transForm.setOutputProperty("omit-xml-declaration", "yes");
            transForm.transform(new DOMSource

to render the pdf:

       Document res = (Document) props.get(sourceKey);
        ByteArrayOutputStream baOs = new ByteArrayOutputStream();
         // renderen van het PDF document
            props.put(targetKey, baOs.toByteArray());
            baOs = null;
            res = null;

Jochen Maes
ICT Development

KBC Securities (
Havenlaan 12 Avenue du Port SIF 8683
B-1080 Brussels
 Tel    :  +32 2 429 96 81              
 GSM    :  +32 496 57 90 99             

This message and any attachments hereto are for the named person's use
only. It may contain confidential, proprietary or legally privileged
information. You may not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. If you have received this e-mail message without being
the intended recipient, please notify KBC Securities promptly and delete
this e-mail. Any views expressed in this message are those of the
individual sender, except where the message states otherwise and the sender
is authorised to state them to be the views of KBC Securities. KBC
Securities reserves the right to monitor all e-mail communications through
its networks and any messages addressed to, received or sent by KBC
Securities or its employees are deemed to be professional in nature. The
sender or recipient of any messages to or of KBC Securities agrees that
those may be read by other employees of KBC Securities than the stated
recipient or sender in order to ensure the continuity of work-related
activities and allow supervision thereof. KBC Securities does not accept
liability for the correct and complete transmission of the information, nor
for any delay or interruption of the transmission, nor for damages arising
from the use of, or reliance on, the information.

                    [EMAIL PROTECTED]                                           
                          To:     [EMAIL PROTECTED]              
                    12/06/2002           Subject:     render DOM to PDF with 
                    respond to                                                  


I have seen in the FopServlet example how to embed the FOP in the servlet.
But the problem is that XSLTInputHandler been used in renderXML method only
takes xml file and xsl file. How can I set up FOP to render a in-memory DOM
object with a specified xsl file to PDF without having to write the DOM out
to a temporary disk file?

Jianbo Mao
CheckFree i-Solutions
Office:  +44 (0) 1753 567896
Mobile: +44 (0) 7810 483974
Fax:      +44 (0) 1753 567897

Reply via email to