cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [FYI] Stefano's Linotype
Date Wed, 23 Apr 2003 22:24:57 GMT
on 4/23/03 8:39 PM Christopher Oliver wrote:

> Uh, sorry, but I think I broke you. 

uh, well, that's the joy of the bleeding edge ;-)

> I recently blasted JXPathTransformer 
> and JXPathTemplate from the scratchpad. If the below still works for 
> you, you  probably still have the old class files in your build 
> directory.  


> There was a lot of code duplication between 
> JXPathTransformer, JexlTransformer, JXPathTemplate and JexlTemplate that 
> needed to be eliminated. So I created a new generator called JXTemplate 
> (which includes JXPath and Jexl) and removed the others. You should use 
> this instead. There is no transformer, however. Do you really need one? 
> If so, I guess it would be easy enough to create a transformer adapter 
> for JXTemplate.

I use it just for one thing: evaluating the continuation ID for the form
action of the editor. I'd be *totally* happy to blast it in favor of a
generator-oriented approach, but I couldn't find how.

This is what I'm doing:

 1) you have an XHTML document on your disk
 2) the document is processed by an XSLT stylesheets that wraps it with
with the inline editor.

As you see, it's not the generation's concern to know about the
continuation, but it's the wrap-up stage that knows about that since the
document might well come from any source (in the future, hopefully, an
XMl database or versioned repository).

The best solution, IMO, would be to allow the XSLT transformer to have
access to flow-injected parameters. This would allow me to avoid that
transformation stage just to expand one single variable.

Another alternative is to write a sitemap input module which the same
functionality so i can do

 <map:generate src="document.xhtml">
 <map:transform src="document2editor.xslt">
  <map:parameter name="continuationID" value="{flow:continuation/id}"/>

So, at the end, I don't need a jxpath transformer, but I *DO* need
flow-injected variable expansion at transformation time.

You probably didn't find those needs because you had total control of
your generation stage, but in my case the document is not a template,
but a datasource fragment and it's my transformation the real template.

[BTW, this duality of generation/transformation templating capabilities
is an *awesome* power. extremely powerful indeed.]


View raw message