On 07.08.2008 10:32:06 xsltuser wrote: > > > The code snippet I have posted is demonstrating the flow for one processing > run. I have deliberately kept all the business logic out of way to ease > understanding. We are also maintaining single instances of FOPFactory and > TransformerFactory in the actual class. > > Regarding XML, I can replace the existing code as follows where java2XML is > using Castor APIs for marshelling. Please advise. > > FileOutputStream fileOut = new > FileOutputStream(xmlFile); > XmlDocument receiptDataXML = new XmlDocument(); > JavaXMLBinding.java2XML(receiptData, receiptDataXML); > receiptDataXML.write(fileOut); > Source src = new StreamSource(xmlFile);
That's even worse. That way you write it to a file. A hard drive is much slower than memory. I haven't found any reference to "XmlDocument" and "JavaXMLBinding" on the net. So I don't have a chance to suggest better approaches. For ideas how to do this efficiently, please look into our tutorial at: http://xmlgraphics.apache.org/fop/0.95/embedding.html#examples But to tell you how to connect Castor in this connect I need access to its Javadocs. But the Javadocs I found on Castor didn't contain the classes "JavaXMLBinding" or "XmlDocument". Maybe these are your own helper classes. At any rate, Castor's Mashaller class supports generating SAX event to a SAX ContentHandler. See: http://www.castor.org/api/org/exolab/castor/xml/Marshaller.html This would avoid the serialization and subsequent parsing of the XML. > We are also doing Exception Handling but no exceptions are thrown in this > scenario. Server shuts down at transformer.transform(src, res);. Last line > displayed in log is 'WARN (FONode) - Warning(Unknown location): fo:table, > table-layout="auto" is currently not supported by FOP' > > > Source src = new StreamSource(xmlInputStream); > > logger.info("After setting source"); > > > > // Resulting SAX events (the generated FO) must be > > piped through to FOP > > Result res = new SAXResult(fop.getDefaultHandler()); > > logger.info("After setting result"); > > > > // Start XSLT transformation and FOP processing > > transformer.transform(src, res); > > INFO (ReceiptTransformer) - After setting source > INFO (ReceiptTransformer) - After setting result > WARN (FONode) - Warning(Unknown location): fo:table, table-layout="auto" is > currently not supported by FOP Doesn't help, I'm afraid. A server or a JVM doesn't just shutdown silently in mid-process. There must be an error message somewhere in a log file (maybe a different one from what you're looking at. Or the operating system logs the crash of an application somewhere. You might also have caught Exception or Throwable somewhere in your code and swallowed the error message. <snip/> Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
