You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stuart Roebuck <sr...@adolos.com> on 2000/09/19 15:12:45 UTC

[C2] Merging pipelines into a new pipeline

Can anyone point me in the right direction with this little problem.  I  
suspect there is an elegant solution in Cocoon 2, but I haven't found it in  
my trawling of the documentation and draft sitemap documents.

I basically want to merge the output (serialized) of two or more pipelines  
as the input (generator) of another.

Currently I do it by creating a dummy.xml file as the generator for a  
pipeline containing an XSLT translator which has code of the form:

<xsl:template match="dummy">
    <new-group>
        <xsl:apply-templates  
select="document('http://localhost:8080/context/pipe1.xml')/group/*" />
        <xsl:apply-templates  
select="document('http://localhost:8080/context/pipe2.xml')/group/*" />
    </new-group>
</xsl:template>


This works, but it's not exactly elegant / scaleable / etc.


If I could do something like:

   <xsl:apply-templates select="document('cocoon://pipe1.xml')/group/*" />
   <xsl:apply-templates select="document('cocoon://pipe2.xml')/group/*" />

...so that I didn't have to go via the server and indicate absolute  
context specific addresses then this would be a big help.

"resources" referred to in the sitemap stuff seem promising, but they are  
referred to as being "redundant", and I'm not quite sure what they are.

Can anyone give me any helpful pointers?

Thanks,

Stuart.

Re: [C2] Merging pipelines into a new pipeline

Posted by Zvi <th...@ifrance.com>.
Hi,

Stuart Roebuck wrote:

> Can anyone point me in the right direction with this little problem.  I
> suspect there is an elegant solution in Cocoon 2, but I haven't found it in
> my trawling of the documentation and draft sitemap documents.
>
> I basically want to merge the output (serialized) of two or more pipelines
> as the input (generator) of another.
>
> Currently I do it by creating a dummy.xml file as the generator for a
> pipeline containing an XSLT translator which has code of the form:
>
> <xsl:template match="dummy">
>     <new-group>
>         <xsl:apply-templates
> select="document('http://localhost:8080/context/pipe1.xml')/group/*" />
>         <xsl:apply-templates
> select="document('http://localhost:8080/context/pipe2.xml')/group/*" />
>     </new-group>
> </xsl:template>
>
> This works, but it's not exactly elegant / scaleable / etc.
>
> If I could do something like:
>
>    <xsl:apply-templates select="document('cocoon://pipe1.xml')/group/*" />
>    <xsl:apply-templates select="document('cocoon://pipe2.xml')/group/*" />

Both solutions, look as a hack to me. Don't you think that this should be way
to programmaticaly merge results of several pipelines at XSP and C2 Sitemap
levels? (without internal HTTP requests, as in your example).
Please look at last messages of "Re: [C2]Access control using sitemap" thread.

Regards,
Zvi



Re: [C2] Merging pipelines into a new pipeline

Posted by Stefano Mazzocchi <st...@apache.org>.
Stuart Roebuck wrote:
> 
> Can anyone point me in the right direction with this little problem.  I
> suspect there is an elegant solution in Cocoon 2, but I haven't found it in
> my trawling of the documentation and draft sitemap documents.
> 
> I basically want to merge the output (serialized) of two or more pipelines
> as the input (generator) of another.
> 
> Currently I do it by creating a dummy.xml file as the generator for a
> pipeline containing an XSLT translator which has code of the form:
> 
> <xsl:template match="dummy">
>     <new-group>
>         <xsl:apply-templates
> select="document('http://localhost:8080/context/pipe1.xml')/group/*" />
>         <xsl:apply-templates
> select="document('http://localhost:8080/context/pipe2.xml')/group/*" />
>     </new-group>
> </xsl:template>
> 
> This works, but it's not exactly elegant / scaleable / etc.
> 
> If I could do something like:
> 
>    <xsl:apply-templates select="document('cocoon://pipe1.xml')/group/*" />
>    <xsl:apply-templates select="document('cocoon://pipe2.xml')/group/*" />

Hmmmm, just stroke me, what about simply

  <xsl:apply-templates select="document('pipe1.xml')/group/*" />

then 

  <xsl:apply-templates select="document('file:///pipe1.xml')/group/*" />

if you wanted a file on the file system?

That way we don't have to extend URL and makes perfect sense to consider
the cocoon pipeline the current context.

What do you think?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------