Respected Sir,

Thanks for the reply.
If I select "Source URL Entry", then against Source Url field there is
browse button, which browses my local machine files.
Should I selecting the transform.xslt using it from my local file system.
(i.e. source url is path of xslt on my local machine like
"file:\C:\Users\shivaadi\Desktop\wso2\transform.xslt")
Or Source url should be path in registry project where I uploaded
transform.xslt.
(i.e. like "file:repository/conf/XSL/transform.xsl").

[image: Inline image 1]

If it has to be path in registry, have I mentioned the path correctly "file:
repository/conf/XSL/transform.xsl"  ?

With Regards,
Aditya

On Tue, Jan 9, 2018 at 8:20 PM, Vinod Kavinda <[email protected]> wrote:

> Hi,
> Select the "Source URL Entry" for the "Local entry Type" field's value.
>
> Thanks,
> Vinod
>
> On Tue, Jan 9, 2018 at 7:04 PM, aditya shivankar <
> [email protected]> wrote:
>
>> Respected Sir,
>>
>> I think the screenshots in the mail are not appearing . Please check
>> attachment ( Local entry of xslt ).
>>
>> With Regards,
>> Aditya
>>
>> On Tue, Jan 9, 2018 at 5:04 PM, aditya shivankar <
>> [email protected]> wrote:
>>
>>> Respected Sir,
>>>
>>>
>>> I went through the online docs.
>>>
>>> My xslt is placed in registry project in below structure :
>>>
>>>
>>>
>>>
>>>
>>>  So I think, if not wrong, I need to create local entry like below
>>>
>>>
>>>
>>> <localEntry key="transform" src="file:repository/conf/XSL/transform.xsl"
>>> />
>>>
>>>
>>>
>>> I right clicked on my App project(TestXsltApp)ànewàlocalentry
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Selected “create a new local entry”
>>>
>>>
>>>
>>>
>>>
>>> But here I find no option to configure the local entry like below:
>>>
>>>
>>>
>>> <localEntry key="transform" src="file:repository/conf/XSL/transform.xsl"
>>> />
>>>
>>>  Please find attached file (Local entry of xslt).
>>>
>>> Thanks please guide.
>>>
>>> On Mon, Jan 8, 2018 at 4:42 PM, Vinod Kavinda <[email protected]> wrote:
>>>
>>>> Hi Aditya,
>>>> You need to add the local entry declaration in the registry inside your
>>>> API config. Without that, synapse does not know the location of your xsl.
>>>> Refer [1] for more details.
>>>>
>>>> <localEntry key="xslt-key-req" src="file:r
>>>> epository/samples/resources/transform/transform.xslt"/>
>>>>
>>>> [1] - https://docs.wso2.com/display/EI611/Working+with+Local+Reg
>>>> istry+Entries
>>>>
>>>> Regards,
>>>> Vinod
>>>>
>>>> On Mon, Jan 8, 2018 at 3:36 PM, aditya shivankar <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks for the reply. But I am getting below error trying it. I think
>>>>> i am not able to configure xslt properly. followed online docs for
>>>>> configuring xslt in wso2 but still not able to. Could you please check my
>>>>> steps (attachment named "xsltTest_stepsFollowed.docx" )and correct me.
>>>>> Thanks.
>>>>>
>>>>>
>>>>> Error :
>>>>>
>>>>> [2018-01-08 15:19:35,020] [EI-Core]  WARN - SynapseConfigUtils Cannot
>>>>> convert null to a StreamSource
>>>>>
>>>>> [2018-01-08 15:19:35,020] [EI-Core] ERROR - XSLTMediator Error
>>>>> creating XSLT transformer using : Value {name ='null', keyValue
>>>>> ='transform'}
>>>>>
>>>>> *org.apache.synapse.SynapseException*: Cannot convert null to a
>>>>> StreamSource
>>>>>
>>>>>
>>>>>
>>>>> With Regards,
>>>>> Aditya
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Jan 7, 2018 at 11:49 PM, Eranda Rajapakshe <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi Aditya,
>>>>>>
>>>>>> You can use XSLT mediator to achieve this, following is a sample
>>>>>> configuration I created.
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <proxy xmlns="http://ws.apache.org/ns/synapse";
>>>>>>>        name="sample"
>>>>>>>        startOnLoad="true"
>>>>>>>        statistics="disable"
>>>>>>>        trace="disable"
>>>>>>>        transports="http,https">
>>>>>>>    <target>
>>>>>>>       <inSequence>
>>>>>>>          <property name="messageType" scope="axis2"
>>>>>>> value="application/json"/>
>>>>>>>          <xslt key="transform"/>
>>>>>>>          <respond/>
>>>>>>>       </inSequence>
>>>>>>>    </target>
>>>>>>>    <description/>
>>>>>>> </proxy>
>>>>>>
>>>>>>
>>>>>>
>>>>>>    <localEntry key="transform">
>>>>>>>         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1
>>>>>>> 999/XSL/Transform">
>>>>>>>             <xsl:template match="/">
>>>>>>>                 <Childern>
>>>>>>>                     <xsl:for-each select="//Children">
>>>>>>>                         <xsl:element name="{Name/Value}">
>>>>>>>                             <xsl:value-of select="Education/Value"/>
>>>>>>>                         </xsl:element>
>>>>>>>                     </xsl:for-each>
>>>>>>>                 </Childern>
>>>>>>>             </xsl:template>
>>>>>>>         </xsl:stylesheet>
>>>>>>>         <description/>
>>>>>>>     </localEntry>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Input will be following,
>>>>>>
>>>>>>
>>>>>>> {
>>>>>>> "Children": [
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Gayle"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "PostGraduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Chris"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Graduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Steve"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "PostGraduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Stephen"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Graduate"
>>>>>>> }
>>>>>>> }
>>>>>>> ]
>>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> Output:
>>>>>>
>>>>>> {
>>>>>>>     "Childern": {
>>>>>>>         "Gayle": "PostGraduate",
>>>>>>>         "Chris": "Graduate",
>>>>>>>         "Steve": "PostGraduate",
>>>>>>>         "Stephen": "Graduate"
>>>>>>>     }
>>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>>
>>>>>> On Sun, Jan 7, 2018 at 6:23 PM, aditya shivankar <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Respected Sir,
>>>>>>>
>>>>>>> I have response from one external service something like below,
>>>>>>> indicating children name and education.
>>>>>>> Each time i call this service with different input, it returns me
>>>>>>> few children( number of children returned could be different each time
>>>>>>> depending on my request data ).
>>>>>>>
>>>>>>>
>>>>>>> Service Response(which needs to be transformed)
>>>>>>> {
>>>>>>> "Children": [
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Gayle"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "PostGraduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Chris"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Graduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Steve"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "PostGraduate"
>>>>>>> }
>>>>>>> },
>>>>>>> {
>>>>>>> "Name": {
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Stephen"
>>>>>>> },
>>>>>>> "Education":{
>>>>>>> "Type": "System.String",
>>>>>>> "Value": "Graduate"
>>>>>>> }
>>>>>>> }
>>>>>>> ]
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Desired Output :
>>>>>>>
>>>>>>> {
>>>>>>> "Gayle": "PostGraduate",
>>>>>>> "Chris": "Graduate",
>>>>>>> "Steve": "PostGraduate",
>>>>>>> "Stephen": "Graduate"
>>>>>>> }
>>>>>>>
>>>>>>> I would  like to do this using PayloadFactory or Enrich component.
>>>>>>> I cannot use dataMapper,because the actual response from service is
>>>>>>> too big and dataMapper GUI hangs and also makes eclipsce to hang forever
>>>>>>> for such big jsons.
>>>>>>> Please guide.
>>>>>>>
>>>>>>> With Regards,
>>>>>>> Aditya
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Dev mailing list
>>>>>>> [email protected]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Eranda Rajapakshe*
>>>>>> Software Engineer
>>>>>> WSO2 Inc.
>>>>>> Mobile : +94784822608
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Vinod Kavinda
>>>> Senior Software Engineer
>>>> *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
>>>> Mobile : +94 (0) 712 415544
>>>> Blog : http://soatechflicks.blogspot.com/
>>>> [image: http://wso2.com/signature]
>>>> <http://wso2.com/signature>
>>>>
>>>>
>>>
>>
>
>
> --
> Vinod Kavinda
> Senior Software Engineer
> *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
> Mobile : +94 (0) 712 415544
> Blog : http://soatechflicks.blogspot.com/
> [image: http://wso2.com/signature]
> <http://wso2.com/signature>
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to