Hi,

We have an call mediator which calls and external API. API response is
json. Json properties has spaces in names.
{
            "Department": "ENGINEERING",
            "Employee Id": "LK",
            "First Name": "Udara",

        }

ESB converts this to xml, those xml element names also have space in
element name.

On Mon, Mar 7, 2016 at 2:05 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> Below is the log mediator output. Even the converted xml tag has space in
> its name.
>
> [2016-03-07 14:00:36,587]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:2b6e4e6d-9180-4083-b06b-d12c08c5178e, Direction:
> request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Body><Result>*<Employee Id>*123*</Employee Id>*<First
> Name>udara</First Name><Last Name>liyanage</Last
> Name></Result></soapenv:Body></soapenv:Envelope>
>
> On Mon, Mar 7, 2016 at 12:06 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
>> Hi Thusitha,
>>
>> I already tried that, but negative.
>>
>> On Mon, Mar 7, 2016 at 11:59 AM, Thusitha Thilina Dayaratne <
>> thusit...@wso2.com> wrote:
>>
>>> Hi Udara,
>>>
>>> Did you tried replace the space with "_x0020_"? according to the [1] it
>>> seems work for spaces
>>> [1] - 
>>> *http://users.jackrabbit.apache.narkive.com/r9aFPfiI/xpath-query-with-space-in-node-name
>>> <http://users.jackrabbit.apache.narkive.com/r9aFPfiI/xpath-query-with-space-in-node-name>*
>>>
>>> Thanks
>>> On Mon, Mar 7, 2016 at 11:43 AM, Udara Liyanage <ud...@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to fetch an property value from a json payload similar to
>>>> below.
>>>> {
>>>>             "Department": "ABC",
>>>>             "Employee Id": "123",
>>>>             "Work Email": "ud...@wso2.com"
>>>>         },
>>>>
>>>> I could extract Department value by below xpath expression.
>>>>
>>>> <property name="test" expression="//Department'"/>
>>>>
>>>> However when I found difficulties when the property name contains an
>>>> space in middle. I tried few options which were not successful.  What is
>>>> the correct way to escape space character.
>>>>
>>>> <property name="test" expression="//'Employee${nbsp}Id'"/>
>>>>
>>>> <property name="test" expression="//'Employee&#x20Id'"/>
>>>>
>>>> --
>>>>
>>>> Udara Liyanage
>>>> Software Engineer
>>>> WSO2, Inc.: http://wso2.com
>>>> lean. enterprise. middleware
>>>>
>>>> web: http://udaraliyanage.wordpress.com
>>>> phone: +94 71 443 6897
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Thusitha Dayaratne
>>> Software Engineer
>>> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>>>
>>> Mobile  +94712756809
>>> Blog      alokayasoya.blogspot.com
>>> About    http://about.me/thusithathilina
>>>
>>>
>>
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to