cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Re: [RT] function sources
Date Tue, 23 Nov 2004 19:46:38 GMT
Miles Elam wrote:
> 3. How easy would it be to wire this into the existing codebase (eg. 
> JXTemplateTransformer)?

It is (relatively) easy, and it has nothing to do neither with 
JXTemplateTransformer, nor with Cocoon core in general.

What you want is easily implemented as a ScriptSource, implementation of a 
Source interface, which would parse function name and parameters from the URI, 
call a method, and serialize (if getInputStream is called), or XML-ize (if toSAX 
is called) returned object.

Proposed URI syntax:

   script:myMethod(param1, param2, param3)

Actually, it won't differ much from what is already possible in Gecko browsers, 
where GIF image source can be obtained as a result of method execution:

     function getPicture(a,b,c) {
       return ...;
   <img src="javascript:getPicture('a', 'b', 'c')"/>


View raw message