cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: Source vs. Generator
Date Wed, 16 Oct 2002 19:30:30 GMT
A long long time ago Carsten Ziegeler wrote:
> Nearly all generators could be rewritten as sources, for
> example the RequestGenerator could be written as a "request:"
> protocol. But does this make sense - I would say: "No". I 
> think a protocol makes sense if several, different sources
> (documents, pieces of information) can be obtained using this
> protocol. For example using an FTP protocol you can fetch
> several files from the FTP server.
> A request protocol for example addresses only one piece of
> information, the request.

After more than three months, I incurred in a scenario that might 
justify the implementation of a RequestSource.

Say you have an HTML form with a textarea field, where the user is 
allowed to paste an HTML (not XHTML) fragment, maybe because he is using 
some rich text editor that outputs a bunch of invalid HTML, like the MS 
rich text editor for IE or Mozilla's ComposIte [1].

Moreover, say that you want to take this text and convert it to 
well-formed XML with JTidy. You could do it all with some custom action 
or XSP page or custom generator. But wouldn't it be much easier to just 
write something like:

<map:generate type="html" src="request://parameters/parametername"/>


Is there's an easier and more elegant alternative? And if there isn't 
one, if I wrote this kind of Source, would it be useful to someone else 
beside me?



Ugo Cei -

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

View raw message