VS: Pipe XSLT Transform to FOP (AND: ABOUT MAIL ARCHIVES)

2002-02-26 Thread Teemu . Talja

Hi 

I looked at the mailing list archives Joerg recommended (are all messages 
written to this mailing list found there)?

If someone is interested in firing FOP with SAX events, the most interesting

messages I found in the archive are 

http://marc.theaimsgroup.com/?l=fop-devm=100559404418852w=2 
and (another message commenting the previous message)
http://marc.theaimsgroup.com/?l=fop-devm=100566543511704w=2

some comments to Joergs message:

I do not think using TraxInputHandler or XSLTInputHandler is 
better than using a DOM tree. TraxInputHandler and XSLTInputHandler are both

making use of Files which is slow instead of being memory-consuming 
(XSLTInputHandler is using Strings in case of smaller documents which is
again 
memory-consuming instead of being slow). I am getting my XML files from a 
database and avoiding memory consumption by writing them (again) to the hard

disk is really not what I want to do :) Is memory consumption not a smaller
problem 
than reading from hard disk? The worst that might happen with memory 
consumption is swapping, that means taking data to the hard disk.

I guess the code example included in the first mentioned archived message 
seems to be the best way to minimize memory consumption using FOP.

the mail archive is very useful, thanks for it :)

-Teemu

 -Alkuperäinen viesti-
 Lähettäjä:Joerg Pietschmann [SMTP:[EMAIL PROTECTED]
 Lähetetty:12. helmikuuta 2002 18:53
 Vastaanottaja:FOP User
 Aihe: Re: Pipe XSLT Transform to FOP
 
 Ryan Howe [EMAIL PROTECTED] wrote:
  Could anyone point me in the right direction of how I could transform
  my XML to PDF without creating an intermediate file?
 
 Look up TraxInputHandler and XSLTInputHandler, or
 Document.getContentHandler()
 in the FOP documentation or the mailing list archives.
 This might get you started
  http://marc.theaimsgroup.com/?l=fop-userw=2r=1s=getcontenthandlerq=b
  http://marc.theaimsgroup.com/?l=fop-userw=2r=1s=xsltinputhandlerq=b
  http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=xsltinputhandlerq=b
  http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=traxinputhandlerq=b
 Be warned, use at least FOP version 0.20.2 to avoid frustration, some
 stuff doesn't work or works differently in 0.19 and 0.20.1
 Do not use PipedStream or an intermediate DOM tree unless you can
 afford wasting memory.
 
 J.Pietschmann


Re: VS: Pipe XSLT Transform to FOP (AND: ABOUT MAIL ARCHIVES)

2002-02-26 Thread Bart Locanthi
Re SAXResult - wonderful! I didn't realize you could do this and had 
been very bothered by the size of the intermediate xsl:fo goo.

I had even gotten to the point of hacking Tomcat and the servlet API to 
support threading and pipes between tags, only to find that Java pipes 
are fundamentally flawed (or broken, depending on your point of view). 
Amazing and quite unforgivable given that Java comes from a Unix company.

And the Tomcat servlet filtering API is also fundamentally (and 
surprisingly) based on single-threading and buffers. Very disappointing.

So three cheers for SAX pipelining for Fop!
Oh, and BTW in another context I have timed using DOM trees vs XML 
strings as intermediate data to feed Xalan, and there was no difference 
that I could measure. May DOM disappear from the face of the earth.

Joerg Pietschmann wrote:
[EMAIL PROTECTED] wrote:
some comments to Joergs message:
I do not think using TraxInputHandler or XSLTInputHandler is
better than using a DOM tree.
Just for clarification: i did not recommend temporary files
over intermediate DOM trees. I recommend a SAX event stream
over any of temporary files, intermediate in-memory buffers
for serialized XML or intermediate DOM trees. A DOM tree is
often still preferable over some serialization because of
performance (no reparsing) but not necessarily because of memory
consumtion (depends on the implementation).



Re: Pipe XSLT Transform to FOP

2002-02-12 Thread Bart Locanthi
Could anyone point me in the right direction of how I could transform
my XML to PDF without creating an intermediate file?
send your XML to a PipedOutputStream pos and use an 
InputSource(pos.getInputStream())

make your XML thing a Thread and start() it.



Re: Pipe XSLT Transform to FOP

2002-02-12 Thread Bertrand Delacretaz
On Tuesday 12 February 2002 02:00, Ryan Howe wrote:
 I have been looking for a way to pipe the output of my Transformer
 into the Input of the FOP Driver object. 

Cocoon (xml.apache.org/cocoon) does just that and much more - you might 
want to have a look!

-- 
 -- Bertrand Delacrétaz, www.codeconsult.ch
 -- web technologies consultant - OO, Java, XML, C++