You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gaston Martini <hg...@ciudad.com.ar> on 2005/01/04 01:19:37 UTC

Dynamic CInclude

Hi,

We're using CInclude for caching purposes and we need to specify its
"src" attribute dinamically, i.e. the value of src is not known in
advance.

We tried some combinations with <xsp:expr>, with no luck. For example,
trying to output the entire cinclude:
    <xsp:expr>test</xsp:expr>
with String test = "<cinclude:cached-include src=\"cocoon:/some_pipeline\"/>",
results in '<' and '>' being translated to &lt; and &gt;:
    &lt;cinclude:cached-include src=\"cocoon:/some_pipeline\"/&gt;

We also tried some other approaches, but nothing worked.

Any suggestions?

Thanks in advance,
Gaston & Martin.




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


Re: Dynamic CInclude

Posted by Jan Hoskens <jh...@schaubroeck.be>.
Gaston Martini wrote:
> Hi,
> 
> We're using CInclude for caching purposes and we need to specify its
> "src" attribute dinamically, i.e. the value of src is not known in
> advance.
> 
> We tried some combinations with <xsp:expr>, with no luck. For example,
> trying to output the entire cinclude:
>     <xsp:expr>test</xsp:expr>
> with String test = "<cinclude:cached-include src=\"cocoon:/some_pipeline\"/>",
> results in '<' and '>' being translated to &lt; and &gt;:
>     &lt;cinclude:cached-include src=\"cocoon:/some_pipeline\"/&gt;
> 
> We also tried some other approaches, but nothing worked.
> 
> Any suggestions?
> 
> Thanks in advance,
> Gaston & Martin.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

I use jx to do the following in my sitemap resource (page parameter is 
given by map:parameter):

<cinclude:include src="cocoon:/${cocoon.parameters.page}" />

Before switching to flow-jxtemplate combination I used xsp:

<xsp:logic>
String dir = "mydir";
</xsp:logic>	
<cinclude:include>
	<xsp:attribute 
name="src">cocoon:/<xsp:expr>dir</xsp:expr>/file.xml</xsp:attribute>
</cinclude:include>

which worked fine.

Remember that the overall cocoon-way-of-thinking heads towards the 
flowscript(glue to your business-logic) and jxtemplate combination 
instead of xsp. (not that you have to do this of course ;-)


Kind Regards,
Jan


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