cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <Giacomo.P...@pwr.ch>
Subject Re: [C2] Merging pipelines into a new pipeline
Date Tue, 19 Sep 2000 21:02:07 GMT
Stuart Roebuck wrote:
> 
> On Tuesday, September 19, 2000, at 06:23 PM, Zvi wrote:
> 
> > 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).
> 
> Yes, I completely agree.  It's a hack because:
> 
> 1. The intermediate pipeline results get mapped to the outside world with
> the sitemap.
> 
> 2. It partially breaks the separation of code and interface (I guess this
> is tied into point 1).
> 
> However, I don't see that we can merge direct from the sitemap.  I think
> we should be able to generate part processed 'components' from the sitemap
> and then access them as if they were local xml input files.   I also like
> the comment from Neeme:
> 
> Neeme Praks wrote:
> > but would it be possible to include only part of the pipeline, so we could
> > get the SAX stream before serializing and when accessing from outside we
> > could have a special serializer that wouldn't output anything ;-)
> 
> It clearly makes no sense to be serialising and then deserialising for
> internal processing.
> 
> Does anyone know what the "resources" sitemap facility was supposed to do
> / does do?

It reduces verbosity in the sitemap. You can redirect to a "resource"
from multiple points in a <map:pipeline> section instead of repeating
your components. For now it is an exit point and a <map:resource> should
specify a serializer to use but this can be changed and make a resource
looks like a placeholder (or subrouting/method call).

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1  856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1  856 2201
Hintereichenstrasse 7                     Mobil: +41 (0)78 759 7703
CH-8166 Niederweningen                    Mailto:Giacomo.Pati@pwr.ch
                                          Web:   http://www.pwr.ch

Mime
View raw message