You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2002/11/04 21:21:50 UTC

Re: Accessing serialized output

It's not possible to access serialized output, you have to write the 
source earlier to disk. There exists a SourceWritingTransformer, but 
it's not available at 
http://xml.apache.org/cocoon/apidocs/org/apache/cocoon/transformation/package-summary.html, 
so I assume it's only available in Cocoon 2.1.x. Add it as last 
transformer in the pipe and it will write the source to disk (with the 
correct serialization??).

<map:read/> does something completely different. It reads files from 
disk and sends them directly (without generating SAX events) to the 
client (http://outerthought.net/wiki/Wiki.jsp?page=Reader).

Regards,

Joerg

Ludovic de Beaurepaire wrote:
> Hi All,
> 
> Excuse me for my poor english.
> I have to access the output after the transformation/serialization and
> before it is send in the HttpResponse, because I have to save it in a file
> and send just a code to the client.
> I tried with redirection in my XSL stylesheet, but just the XML datas are
> saved, it is NOK.
> I tried coding my own reader, but I have a compilation error in the sitemap
> written like this :
> 
> ...
>   <map:readers default="resource">
>     <map:reader name="srvimp" src="infolis.srvimp.SrvImpReader"/>
>   </map:readers>
> ...
>  <map:pipelines>
>   <map:pipeline>
>    <map:match pattern="test.xsp">
>     <map:generate type="xsp" src="content/xml/GENERAL.xsp"/>
>     <map:transform src="style/xsl/GENERAL_u.xsl"/>
>     <map:serialize type="fo2pdf"/>
>     <map:read type="srvimp" mime-type="text/html"/>
>    </map:match>
>   </map:pipeline>
>  </map:pipelines>
> ...
> 
> Does somewone know the solution to work with the output of the event
> pipeline ?
> 
> Thanks,
> 
> Ludovic


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Accessing serialized output

Posted by Ludovic de Beaurepaire <lu...@axonie.com>.
Thank you for your answer,

I have finally done your solution (write the source earlier to disk), using
a XSL stylesheet redirecting the generated XML in a local file. This file is
transformed/serialized when the PDF file is required later. I 'd prefer your
solution to save it after the XSLT transformation, i found documentation at
http://xml.apache.org/cocoon/userdocs/transformers/sourcewriting-transformer
.html, but this transformer is not in my cocoon distribution (2.0.3).

i will wait for Cocoon 2.1.x !

Regards,

Ludovic

----- Original Message -----
From: "Joerg Heinicke" <jo...@gmx.de>
To: <co...@xml.apache.org>
Sent: Monday, November 04, 2002 9:21 PM
Subject: Re: Accessing serialized output


> It's not possible to access serialized output, you have to write the
> source earlier to disk. There exists a SourceWritingTransformer, but
> it's not available at
>
http://xml.apache.org/cocoon/apidocs/org/apache/cocoon/transformation/packag
e-summary.html,
> so I assume it's only available in Cocoon 2.1.x. Add it as last
> transformer in the pipe and it will write the source to disk (with the
> correct serialization??).
>
> <map:read/> does something completely different. It reads files from
> disk and sends them directly (without generating SAX events) to the
> client (http://outerthought.net/wiki/Wiki.jsp?page=Reader).
>
> Regards,
>
> Joerg
>
> Ludovic de Beaurepaire wrote:
> > Hi All,
> >
> > Excuse me for my poor english.
> > I have to access the output after the transformation/serialization and
> > before it is send in the HttpResponse, because I have to save it in a
file
> > and send just a code to the client.
> > I tried with redirection in my XSL stylesheet, but just the XML datas
are
> > saved, it is NOK.
> > I tried coding my own reader, but I have a compilation error in the
sitemap
> > written like this :
> >
> > ...
> >   <map:readers default="resource">
> >     <map:reader name="srvimp" src="infolis.srvimp.SrvImpReader"/>
> >   </map:readers>
> > ...
> >  <map:pipelines>
> >   <map:pipeline>
> >    <map:match pattern="test.xsp">
> >     <map:generate type="xsp" src="content/xml/GENERAL.xsp"/>
> >     <map:transform src="style/xsl/GENERAL_u.xsl"/>
> >     <map:serialize type="fo2pdf"/>
> >     <map:read type="srvimp" mime-type="text/html"/>
> >    </map:match>
> >   </map:pipeline>
> >  </map:pipelines>
> > ...
> >
> > Does somewone know the solution to work with the output of the event
> > pipeline ?
> >
> > Thanks,
> >
> > Ludovic
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>