You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robby Pelssers <Ro...@nxp.com> on 2012/05/15 12:15:26 UTC
how to pass parameters to a service transformer
Hi all,
I've got a question regarding the service transformer. How do I pass any parameters to the service? The demo from get-started page is not clear on this topic.
<map:match pattern="custom-transformation-service/*">
<map:generate src="service-consumer:"/>
<map:transform src="xslt/custom_transformer.xslt" type="saxon">
<map:parameter name="separator" value="{1}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
<!--
Currently I pass on the parameter by extracting the separator from the match pattern
but is there another way? First of all i'm asking because i foresee issues in doing it this way.
Secondly I see use cases where I need to pass a bunch of parameters and i don't want ugly match patterns.
Suppose I want to pass on two URL's as parameters, I'm already blocked with this approach.
-->
<map:match pattern="test-csv-transformer-service">
<map:generate src="data/testdata.xml"/>
<map:transform type="servletService">
<map:parameter name="service" value="servlet:shared:/custom-transformation-service/	"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
Robby
Re: how to pass parameters to a service transformer
Posted by gelo1234 <ge...@gmail.com>.
Hi,
Passing parameters within URL (Query Params) doesn't work in C3 ?
<map:transform type="servletService">
<map:parameter name="service"
value="servlet:/custom-transformation-service/?sep=	"/>
</map:transform>
Greetings,
Greg
2012-05-15 12:15 GMT+02:00 Robby Pelssers <Ro...@nxp.com>:
> Hi all,
>
>
>
> I've got a question regarding the service transformer. How do I pass any
> parameters to the service? The demo from get-started page is not clear on
> this topic.
>
>
>
>
>
> <map:match pattern="custom-transformation-service/*">
>
> <map:generate src="service-consumer:"/>
>
> <map:transform src="xslt/custom_transformer.xslt" type="saxon">
>
> <map:parameter name="separator" value="{1}"/>
>
> </map:transform>
>
> <map:serialize type="xml"/>
>
> </map:match>
>
>
>
> <!--
>
> Currently I pass on the parameter by extracting the separator from the
> match pattern
>
> but is there another way? First of all i'm asking because i foresee
> issues in doing it this way.
>
> Secondly I see use cases where I need to pass a bunch of parameters and i
> don't want ugly match patterns.
>
> Suppose I want to pass on two URL's as parameters, I'm already blocked
> with this approach.
>
> -->
>
> <map:match pattern="test-csv-transformer-service">
>
> <map:generate src="data/testdata.xml"/>
>
> <map:transform type="servletService">
>
> <map:parameter name="service"
> value="servlet:shared:/custom-transformation-service/	"/>
>
> </map:transform>
>
> <map:serialize type="xml"/>
>
> </map:match>
>
>
>
> Robby
>