You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Luca Morandini <lu...@tin.it> on 2003/06/23 15:52:01 UTC
Re: Pass parameter to a transformer
Anna Afonchenko wrote:
> Hi all.
> I have written my own transformer, that gets in an XML file as a parameter.
> If I declare the parameter in the transformers bit:
>
> <map:transformer
> name="xsl5complete" src="com.ubaccess.xsl5.cocoon.XSL5Transformer">
> <parameter name="xsl5" value="xsl5new.xml"/>
> </map:transformer>
>
> and then call it in the pipeline:
> <map:transform type="xsl5complete"/>
>
> it works fine.
> But I wnat to pass the XMLfile name dynamically, and not when I declare
> the transformer, e.g.,
> I want something like:
>
> <map:transformer
> name="xsl5complete" src="com.ubaccess.xsl5.cocoon.XSL5Transformer"/>
>
> <map:transform type="xsl5complete">
> <parameter name="xsl5" value="xsl5new.xml"/>
> </map:transform>
>
> But this doesn't work.
> How can I pass a dynamic parameter to my transformer, and what am I
> doing wrong here?
>
> Thank you very much for your help.
>
> Anna
>
>
You should use the "configure" method of your transformer's class (which
I suppose is derived from AbstractSAXTransformer) and not the "setup" one.
To setup a component (in the "components" section) is different from
configuring one (in a pipeline) ;)
Regards,
------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
http://space.virgilio.it/kumora/index.html
------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org