Hi Zsombor, 

> > [Geert]
> > Besides, it is a pity that the serializer you created has such a 
> > limited use case, while mine can be used in many situations. And I 
> > always found transformers much more powerfull than serializers.
> 
> [Zsombor]
> But how can you use the FPO fo2pdf serializer in a 
> transormer? It's my only problem.
> Untill now i only use transformers to create xml from other 
> xml generated by the generator.
> So how can i create a pdf document or a jpeg image with a transformer?

Well.. That is the real magic of my transformer.. ;-)

No, it is actually not that complex. The sourcewritingtransformer and
first use case for my savefilestransformer takes an xml fragment. But
you need a stream to be able to write to a file. That is provided by a
serializer (specified by the serializer attribute of the element that
wrapped the fragment and) that is instantiated *inside* the
transformer.. :-)

During the parsing of the fragment, the events are passed to the
serializer that writes to the output stream that I provided to it. At
the end of the fragment, the serializer is disconnected and events
continue their path through Cocoon.

The second use case of my transformer interrupts the events to open a
new input source which takes any url type that Cocoon can process, gets
the input stream from the source and simply copies the input stream to
the output stream. Because this does not involve a serializer, it can
also handle binary streams.. :-)

> > [Geert]
> > Have you noted my remark about making internal calls? 
> > Something to keep in mind when using your serializer.
> >
> > > When calling pipes internally, serializers are 
> circumvented and that
> is most likely not what you want.
> 
> [Zsombor]
> What kind of internal calls do you think? What is an internal 
> call of the pipe?

Internal calls use the cocoon protocol, eg:

        cocoon:/other-match-in-same-sitemap

Or

        cocoon://path-from-root/match-in-other-sitemap

If you have a pipeline that generates PDF with the fo2pdf serializer and
call it from another through a generate using the cocoon protocol, the
generater simply bypasses or replaces the serializer of the PDF
generating pipeline! That is also the reason why using a reader on a
cocoon pipeline (intentionally) does not work (though generating the
result of a reader does work, or was it the other way around? I am
always getting confused about it).. :-P

Kind regards,
Geert
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to