Loading ...
Sorry, an error occurred while loading the content.
 

XSL-FO Query

Expand Messages
  • Alok_Jain
    Hi All I need to transform multiple XML s with a single XSL-FO file to generate a single PDF File. What I want is that the data from subsequent XML s should
    Message 1 of 1 , Dec 14, 2004
      Hi All

      I need to transform multiple XML's with a single XSL-FO file to generate
      a single PDF File. What I want is that the data from subsequent XML's
      should append to the PDF after transformation. But when I try to do it
      from my java code, the data is visible only of the last XML, though the
      file size says that the data is there in the file. I think during
      transformation it overwrites. Is there any way to do this.

      I am using the following Code:

      This will run in a loop where you will provide different xml name
      everytime.

      xmlReader = new StringReader(xmlName);
      Source src = new StreamSource(xmlReader);

      xslReader = new StringReader(getCacheObject(xsl));

      TransformerFactory factory =
      TransformerFactory.newInstance();
      Transformer transformer =
      factory.newTransformer(new
      StreamSource(xslReader));

      Driver driver = new Driver();
      driver.setLogger(new NullLogger());
      driver.setRenderer(Driver.RENDER_PDF);

      outStream = new ByteArrayOutputStream();
      driver.setOutputStream(outStream);

      Result res = new SAXResult(driver.getContentHandler());

      transformer.transform(src, res);

      return outStream.toByteArray();


      -Alok
      "Always borrow money from a pessimist; he doesn't expect to be paid
      back..."



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.