It's called a CastorTransformer because it is a cocoon transformer.

So why is it a transformer ?

In fact, it might have been a generator. But when you use the
CastorGenerator, what you usually want to do is to INSERT the xml
serialization of a Bean into the current flow of datas.
Image you have a table, and you want to insert 3 beans in 3 <td />'s of the
table.

If you hade a generator, you must do :

-Generate <mybean> <bean1 /> <bean2 /> <bean3/> </bean>
-Make an XSL stylesheet that will wrap the <table /> and <td />'s  around
the beans.

With a generator, you can :

-Define an XML file with <table> <td><insert-bean /></td>...
-Use the transformer to replace the <insert-bean />'s with the apropriate
content in the flow.

With a transformer, you also can re-transform to insert new beans later in
the pipeline, wich is not possible (without cinclude) if you use a
generator.


fabien.

>-----Message d'origine-----
>De: Werner Guttmann [mailto:[EMAIL PROTECTED]]
>Date: mardi 9 juillet 2002 17:22
>À: [EMAIL PROTECTED]
>Objet: CastorTransformer
>
>
>Hi,
>
>I had a look at the CastorTransformer the other day to familiarize
>myself with how things are implemented, etc. I still fail to understand
>why this component is actually called Castor*Transformer* when clearly
>it's role is that of a generator, i.e. a component responsible for
>inserying XML (SAX events) into a pipeline.
>
>Can anybody please enlighten me whether I am misunderstanding/missing
>anything fundamental ...
>
>Thanks
>Wenrer
>
>
>---------------------------------------------------------------------
>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:     <[EMAIL PROTECTED]>
>For additional commands, e-mail:   <[EMAIL PROTECTED]>
>

---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to