Hi everybody,

first... happy new year to everybody, as this is my first posting in 2003...

Again I got a serious problem rendering an XML-Document containing more than
1024 Bytes. The following happens:

I got a Method that takes an XSL-Stylesheet and and XMLDocument as parameter
to generate the PDF-Output as an Byte[]:

-- snip --
 public byte[] createContent(int template, XMLDocument xmlDoc) throws
Exception {

  System.setProperty("org.xml.sax.driver",
"org.apache.xerces.parsers.SAXParser");

  String xslTemplate = "";
  // Template definieren
  switch (template) {
   case 1:
    xslTemplate = "1.xsl";
    break;
   case 2:
    xslTemplate = "2.xsl";
    break;
   case 3:
    xslTemplate = "3.xsl";
    break;
  }

  // OutputStream für binäre Daten der PDF-Datei erzeugen
  ByteArrayOutputStream out = new ByteArrayOutputStream();

  // Driver für den PDF-Renderer initialisieren
  Driver driver = new Driver();
  driver.setOutputStream(out);
  driver.setRenderer(Driver.RENDER_PDF);

  // DOM-Factory laden um XML-Struktur zu parsen
  DOMFactory domFact = new DOMFactory();
  xmlDoc.output(domFact.getOutputStream());

  //XSL-Handler initialisieren
  XSLTInputHandler inputHandler = new XSLTInputHandler(new File(""), new
File(xslTemplate));
  XMLReader parser = inputHandler.getParser();
  driver.setOutputStream(out);

  // XML-Dokument anhand XSL-Definition parsen
  driver.render( parser, new InputSource(new
ByteArrayInputStream(xmlDoc.toString().getBytes())));

  return out.toByteArray();
 }

-- snap --

Now, in the application itself I build up an XMLDocument
(org.apache.ecs.xml.XMLDocument). Rendering this XML-Document was quite good
until now. Suddenly the rendering stopped without any warning, any error or
any comment. When searching for any reason, I tried to have the XML-Document
written on STDOUT by

System.out.writeln(xmlDoc.toString());

Using this it became obvious, that the rendering runs quite fine until the
xmlDoc (represented by it's String on STDOUT) reaches 1024 bytes. Having
1025 bytes it hangs.

Has anybody an idea how to fix this ? I can't imagine that FOP has problems
with more than 1KB of data, or has it ?

Thanks for any help in advance...


Marcus


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

Reply via email to