Hi Aditya,
It seems you have put the XSLT in API folder and try to access it in
incorrect way.
You can do this by either one of following ways and the first one is the
recommended.
1. Put the XSLT to the registry. you can find more information
in[1][3]. If you change the xslt in registry it will effect imidiatly.
2. Put it as local entry[1][2], XSLT change exffect only after next API
or peoxy deployment.
- <!-- define the request processing XSLT resource as a static
URL source -->
<localEntry key="xslt-key-req" src=
"file:repository/samples/resources/transform/transform.xslt"/>
[1]
https://docs.wso2.com/display/ESB500/Sample+8%3A+Introduction+to+Static+and+Dynamic+Registry+Resources+and+Using+XSLT+Transformations
[2]
http://mytecheye.blogspot.com/2013/12/wso2-esb-xslt-mediator-xslt-imports.html
[3]
https://www.linkedin.com/pulse/wso2-esb-message-transformation-mapping-using-xslt-isuru-jayakantha
Thanks and Best Regards,
Saneth Dharmakeerthi
*Associate Technical Lead*
WSO2, Inc.
Mobile: +94772325511
<http://wso2.com/signature>
On Wed, Nov 15, 2017 at 6:40 PM, aditya shivankar <
[email protected]> wrote:
> Respected Sir,
>
> I have one xslt .
> I have saved it inside api(src/main/synapse-config/api) folder in my
> project.
> I am trying to access it using xslt mediator like below.
>
> <xslt key="api/test.xsl" source="$body/jsonObject"/>
>
> But getting below error.Full logs can be found in attachment .
>
> [2017-11-15 18:11:39,128] [EI-Core] INFO - DependencyTracker Local entry
> : api/test.xsl was added to the Synapse configuration successfully
> [2017-11-15 18:11:39,129] [EI-Core] WARN - SynapseConfigUtils Cannot
> convert null to a StreamSource
> [2017-11-15 18:11:39,131] [EI-Core] ERROR - XSLTMediator Error creating
> XSLT transformer using : Value {name ='null', keyValue ='api/test.xsl'}
> org.apache.synapse.SynapseException: Cannot convert null to a StreamSource
> at org.apache.synapse.config.SynapseConfigUtils.handleException(
> SynapseConfigUtils.java:580)
> at org.apache.synapse.config.SynapseConfigUtils.getStreamSource(
> SynapseConfigUtils.java:81)
> at org.apache.synapse.mediators.transform.XSLTMediator.
> createTemplate(XSLTMediator.java:420)
> at org.apache.synapse.mediators.transform.XSLTMediator.
> performXSLT(XSLTMediator.java:268)
> at org.apache.synapse.mediators.transform.XSLTMediator.
> mediate(XSLTMediator.java:227)
> -----------------------------------------------------------
> I tried printing body/jsonObject just one line before call to xslt. And it
> printed full payload, somewhat like below. So the payload is not empty.
>
> <jsonObject><Items>.....</Items></jsonObject>
>
> <log level="custom">
> <property expression="$body/jsonObject" name="msg21"/>
> </log>
>
> Please Guide.
>
> With Regards,
> Aditya
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev