You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brent Eades <be...@almonte.com> on 2003/10/10 15:22:46 UTC

Greetings and question

Hello all,

I subscribed to this list awhile back, when I was evaluating Cocoon 2.0. In time I had to put it 
aside. Now I'm returning to it, as I hope it may be the right tool for a couple of of projects I 
have underway.

My background: I manage web operations for a central bank. I'm not primarily a developer, 
though I know the basics of the environments that Cocoon runs in. (e.g., I have a general 
grasp of Java, Tomcat, XML/XSLT, etc.)  However, there are numerous large gaps in my 
knowledge. So please bear with me if some of my questions are kind of simple-minded :)

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 his 
local drive, pass it to an XSLT transformer, and view the generated HTML file. See this URL 
for a related page I have running:

    http://centralbanks.net/sdmx/sdmx_xsl.html

So I want something similar to this page, except that users could upload their own XML files, 
rather then merely select pre-existing ones from a list. The XSLT file would be 'hard coded' 
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?

I'm running Cocoon 2.2.1 under JDK 1.4, Tomcat 4.1.1.8, and Linux.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Greetings and question

Posted by Geoff Howard <co...@leverageweb.com>.
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 his 
> local drive, pass it to an XSLT transformer, and view the generated HTML file. See this URL 
> for a related page I have running:
> 
>     http://centralbanks.net/sdmx/sdmx_xsl.html
> 
> So I want something similar to this page, except that users could upload their own XML files, 
> rather then merely select pre-existing ones from a list. The XSLT file would be 'hard coded' 
> 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.

Geoff



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org