You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Willy Reinhardt <wr...@novell.com> on 2004/06/17 15:25:41 UTC

Sitemap how to link the serialization result to an other generator ?

Hi,
I tried to pre-processed an xsp (to set default value according i18n
value) but I don't know how to link a serialized result to another
generator
The procedure I need is:

1) match an xsp request
2) read and generate sax event as with any xml file
3) Transform using i18n transformer
4) Serialize to xml
5) Get the serialized output
6) Use the serialized data's as entry of serverpage generator
7) xsl to html

My problem is I don't know how to do the steps 5 and 6. 

The following sitemap sample code illustrate what I am trying to do

<map:match pattern="menu.xsp">
  <map:generate type="file" src="xsp/menu.xsp"/>
  <map:transform type="i18n">
    <map:parameter name="locale" value="{../locale}" />
  </map:transform>
  <map:serialize type="xml"/>

>>>> ???? how to link this 2 steps  

  <map:generate type="serverpages" src="xsp/menu.xsp"/>
  <map:transform type="xslt" src="style/menu-html.xsl"/>
  <map:serialize type="html"/>
</map:match>

Thanks

Willy


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


Re: Sitemap how to link the serialization result to an other generator ?

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 18/giu/04, alle 07:48, Joerg Heinicke ha scritto:

> On 17.06.2004 15:25, Willy Reinhardt wrote:
>
>> Hi,
>> I tried to pre-processed an xsp (to set default value according i18n
>> value) but I don't know how to link a serialized result to another
>> generator
>> The procedure I need is:
>> 1) match an xsp request
>> 2) read and generate sax event as with any xml file
>> 3) Transform using i18n transformer
>> 4) Serialize to xml
>> 5) Get the serialized output
>> 6) Use the serialized data's as entry of serverpage generator
>> 7) xsl to html
>
> The second pipeline must fetch the content of the first one by using 
> cocoon:/ pseudo protocol. It results in an internal request that is 
> again matched in the sitemap. For the above it should be
> <map:generate type="serverpages" src="cocoon:/menu.xsp"/>
> as the matcher of the first pipeline is just "menu.xsp".

Willy,

what Joerg wrote is fine, but keep in mind that if you generate the XSP 
source every time, you incur the costs of translation to Java and 
compilation for *every* request. In other words, it will work but will 
be unbearably slow.

	Ugo

-- 
Ugo Cei - http://beblogging.com/


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


Re: Sitemap how to link the serialization result to an other generator ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.06.2004 15:25, Willy Reinhardt wrote:

> Hi,
> I tried to pre-processed an xsp (to set default value according i18n
> value) but I don't know how to link a serialized result to another
> generator
> The procedure I need is:
> 
> 1) match an xsp request
> 2) read and generate sax event as with any xml file
> 3) Transform using i18n transformer
> 4) Serialize to xml
> 5) Get the serialized output
> 6) Use the serialized data's as entry of serverpage generator
> 7) xsl to html
> 
> My problem is I don't know how to do the steps 5 and 6. 
> 
> The following sitemap sample code illustrate what I am trying to do
> 
> <map:match pattern="menu.xsp">
>   <map:generate type="file" src="xsp/menu.xsp"/>
>   <map:transform type="i18n">
>     <map:parameter name="locale" value="{../locale}" />
>   </map:transform>
>   <map:serialize type="xml"/>
> 
>>>>>???? how to link this 2 steps  
> 
> 
>   <map:generate type="serverpages" src="xsp/menu.xsp"/>
>   <map:transform type="xslt" src="style/menu-html.xsl"/>
>   <map:serialize type="html"/>
> </map:match>

The second pipeline must fetch the content of the first one by using 
cocoon:/ pseudo protocol. It results in an internal request that is 
again matched in the sitemap. For the above it should be
<map:generate type="serverpages" src="cocoon:/menu.xsp"/>
as the matcher of the first pipeline is just "menu.xsp".

Joerg


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