Jeremias, Thank you so much for your detailed information. It really helps me a lot.
Based on your suggestion, I am going to implement it. I will let you know what I get. Best regards, Jerry --- Jeremias Maerki <[EMAIL PROTECTED]> wrote: > Hello Jerry, > > On 07.04.2004 19:07:05 Jerry wrote: > > Jeremias, > > > > Thank you for your suggestions. > > > > The soultion you gave me here is very intrigue to > me. > > However, I cannot fully understand your point. > Would > > you please clarify for me if the following > approach is > > not what you mean? > > > > 1. I need to write a new servlet which will return > a > > ByteArrayInputStream which take the binary tiff > data > > from database. > > Just nitpicking: Your new servlet writes the TIFF > file byte by byte to > the Request's OutputStream. > > > 2. Modify my current servlet and set the URL to my > new > > servlet as a parameter to the XSL file using the > > following: > > > > //assume the new servlet is GetByteStreamServlet > > String > NewServletURL="/GetByteStreamServlet?id=123" > > Right! Something like that, if the base URL is set. > YOu might have to > use http://localhost/.... > > > TransformerFactory factory = > > TransformerFactory.newInstance(); > > Transformer transformer = > > factory.newTransformer(new > StreamSource(xsltfile)); > > > > > > //pass NewServletURL to image variable in > > xsltfile, is this corect? > > transformer.setParameter("image", > > NewServlet); > > Correct. > > > > > If above correct, I also modify XSL file like > this: > > ... > > <fo:external-graphic width="50pt" height="50pt" > > overflow="hidden" src="URL('[EMAIL PROTECTED]')"/> > > ... > > Correct. > > > If I use this way, how can set Source parameter of > > transformer.transform((Source)?, res)? I am not > sure > > of this part. > > The source document is probably a dummy XML > document, just like this: > > <dummy/> > > That's enough. > > > Please correct me if I misunderstood your point. > > No, you did alright. The XSLT you posted on the list > earlier will > probably not work however. It doesn't look right. At > least an embracing > xsl:template is missing: > > <xsl:template match="/"> > <!-- your xsl-fo code here --> > </xsl:template> > > > Create the TIFF-serving Servlet first and then get > your XSLT stylesheet > together from the command-line. You can test the > TIFF-Servlet from your > browser. If both are working go back to your > original servlet and finish. > > For the next time, please don't write directly to > those who answer > questions. Others won't be able to profit from the > solutions I'm giving > you, as I can't tell whether you'd agree if I simply > sent my answer to > the list again. > -- > Jeremias Maerki <[EMAIL PROTECTED]> > __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
