On Thursday, August 15, 2002, at 10:53 AM, kyle koss wrote:

> Is it possible for Cocoon to do an XML+XSL -> PDF transformation, but 
> instead of serving the PDF into the browser, writing it to a file?
>
> What I would like to do is, take information entered into a form on a 
> jsp page, turn it into an XML file, and then apply my XSL to it to 
> produce a PDF which is then stored to disk on the server.
>
> Can this be done using Cocoon, or would it be easier to just use FOP 
> embedded in a servlet? If it can be done, what do I have to do?

I can't think of any way to do this with the included Cocoon components, 
but you could write an action that does this. Create a matcher that does 
the XML+XSL->PDF transformation, then in an action access the url for 
that matcher and saves to a file. I forget if action can access a 
pipeline with in an action with something like 
resolver.resolve("cocoon:/pdf"), if not you'll have to use the 
java.net.url classes.

You could also write an action that actually loads the file, performs 
the transformation, serializes to PDF and writes the file, all 
configurable by sitemap parameters, but the action that saves a url to a 
file seem more generally usable, it could be a good addition to Cocoon.

Justin


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to