Title: RE: Converting XML-FO

Andrew:

Here is one approach:

public class CreateFO {

  public CreateFO() {
    this.makeFO(new File("D:/JavaProjects/RendererWrapper/test/and.xml"),
                   new File("D:/JavaProjects/RendererWrapper/test/and.xsl"),
                   new File("D:/JavaProjects/RendererWrapper/test/and.fo"));
  }

  public void makeFO(File xmlFile, File xslFile, File outFile){
    try {
      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer t = tf.newTransformer(new StreamSource(xslFile));
      t.transform(new StreamSource(xmlFile), new StreamResult(outFile));

    }catch(Exception ex){
    System.out.println("error"+ex.getMessage());
    }
}

  public static void main(String[] args) {
    CreateFO createfo = new CreateFO();
  }
}


Rob

-----Original Message-----
From: andrew mercer [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 14, 2003 10:44 AM
To: [EMAIL PROTECTED]
Subject: Converting XML-FO

Hi,

I am looking for code as an example as to how I can convert an xml file
to a .fo file before converting this file to a pdf file.

I have been going straight from a xml -> pdf keeping the .fo in memory
using the example on the FOP web site. However there is a major
exponential memory issue with large files that cause them to either run
out of java memory (currently I set this to amximum of 512m) or take
forever to finish.

I therefore want to do the process in two stages.

It says on the FOP web sites that I can find examples in the extracted
download at: xml-fop/examples/embedding. However I do not have this
directory in either version 0.20.3 or 0.20.4 or in the source download
for 0.20.4.

Am I doing something wrong or can I be pointed in the right direction or
  can a sample of code be sent.

I will continue looking on the FOP archive but have not found anything
so far.

Thanks for your help in advance.

Andrew
--


Andrew Mercer, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.


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

Reply via email to