You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Björn Voigt <bv...@hs-harz.de> on 2004/03/22 10:20:47 UTC

Using sitemap parameters in a cinclude transformation

Moin Cocooners,

I want aggregate some internal pipelines. The generated file
should have a more complex structure instead of only one root element,
which the simple sitemap aggregation is providing.

I want use the cinclude mechanism, but it seems to be not able to
handle parameters from the sitemap. Is this not possible with cinclude?

I will replace this:

       <map:match pattern="*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/menu-{0}"/>
           <map:part src="cocoon:/body-{0}"/>
         </map:aggregate>
        <map:transform type="encodeURL"/>
     [...]
       </map:match>

with something like this:

<map:match pattern="pattern="*.html"">
   <map:generate src="aggregation.xml"/>
   <map:transform type="cinclude">
     <map:parameter name="value" value="{1}"/>
   </map:transform>
   [...]
</map:match>

<site xmlns:cinclude="http://apache.org/cocoon/include/1.0">
     <cinclude:include src="cocoon:/menu-{value}"/>
     <cinclude:include src="cocoon:/menu-{value}"/>
</site>

Thank you for helpfull ideas,

Björn Voigt



Re: Using sitemap parameters in a cinclude transformation

Posted by Joerg Heinicke <jo...@gmx.de>.
On 22.03.2004 10:20, Björn Voigt wrote:

> Moin Cocooners,
> 
> I want aggregate some internal pipelines. The generated file
> should have a more complex structure instead of only one root element,
> which the simple sitemap aggregation is providing.
> 
> I want use the cinclude mechanism, but it seems to be not able to
> handle parameters from the sitemap. Is this not possible with cinclude?
> 
> I will replace this:
> 
>       <map:match pattern="*.html">
>         <map:aggregate element="site">
>           <map:part src="cocoon:/menu-{0}"/>
>           <map:part src="cocoon:/body-{0}"/>
>         </map:aggregate>
>        <map:transform type="encodeURL"/>
>     [...]
>       </map:match>
> 
> with something like this:
> 
> <map:match pattern="pattern="*.html"">
>   <map:generate src="aggregation.xml"/>
>   <map:transform type="cinclude">
>     <map:parameter name="value" value="{1}"/>
>   </map:transform>
>   [...]
> </map:match>
> 
> <site xmlns:cinclude="http://apache.org/cocoon/include/1.0">
>     <cinclude:include src="cocoon:/menu-{value}"/>
>     <cinclude:include src="cocoon:/menu-{value}"/>
> </site>

This will indeed not work. You have to add a stylesheet infront of the 
cinclude transformer adding the sitemap parameters to the include/@src.

Joerg