cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <>
Subject Re: Greetings and question
Date Fri, 10 Oct 2003 16:42:22 GMT
Brent Eades wrote:


> Now for my first question. I have a requirement to create an 'interactive' XML/XSLT 
> transformer. This would entail a web form to which a user could upload an XML file from
> local drive, pass it to an XSLT transformer, and view the generated HTML file. See this
> for a related page I have running:
> So I want something similar to this page, except that users could upload their own XML
> rather then merely select pre-existing ones from a list. The XSLT file would be 'hard
> in.
> It seems to me this should be fairly simple to do in Cocoon 2.1.1 Does anyone have some

> existing code samples they could point me to here?

First see the wiki for file uploads.  As things stand, I think you'll 
need to create an action to get the filename of the temporary uploaded 
file.  Then, it's just a normal FileGenerator->XSLT 
Transformer->HTMLSerializer pipeline where the src of the generator is 
filled in from the filename returned by your action.

You may be able to skip the action and just use an input module to fill 
in the source of your file src="{request-param:name-of-upload-field}". 
That may work because of a fortuitous use of toString() and the default 
setting to temporarily create an actual file on disk in the upload dir.

Failing that one could also create a special input module to provide 
that filename.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message