Hi Aman,

Since OM type property is defined with the default namespace, you need to
perform xpath expression with that namespace.

    <property name="nameA" xmlns:ns="http://ws.apache.org/ns/synapse";
expression="$ctx:names//ns:Names/ns:A/text()"/>

Thanks

On Mon, Sep 17, 2018 at 3:17 PM, Aman Singh <[email protected]> wrote:

> Hi Shakila,
>
> I tried by Keeping the type as "OM" , but the output of log is still blank.
>
> Thank you,
> Aman
>
> On Mon, 17 Sep 2018, 14:49 Shakila Sasikaran, <[email protected]> wrote:
>
>> Hi Aman,
>>
>> Please define the type of the property as *OM* and try as follows.
>>
>>     <property name="names"
>>               expression="get-property('registry','conf:/
>> CollectionTest/LocalEntry1.xml')"
>>               scope="default"
>>               type="*OM*"/>
>>     <property name="nameA"
>>               expression="$ctx:names//Names/A/text()"
>>               scope="default"
>>               type="STRING"/>
>>
>> Thanks
>>
>> On Mon, Sep 17, 2018 at 2:35 PM, Aman Singh <[email protected]>
>> wrote:
>>
>>> Hi All,
>>>
>>> I have a local Entry File XML named "LocalEntry1". I have also stored it
>>> in registry.
>>> My Local Entry File Looks like below:-
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <localEntry key="LocalEntry1" xmlns="http://ws.apache.org/ns/synapse";>
>>> <Names>
>>> <A>value</A>
>>> <B>value</B>
>>> <C>value</C>
>>> <D>value</D>
>>> <E>value</E>
>>> <F>value</F>
>>> </Names>
>>> </localEntry>
>>>
>>> When I am trying to fetch the whole local entry file via below code, I
>>> am able to get the whole file as output:-
>>> <property expression="get-property('registry','conf:/
>>> CollectionTest/LocalEntry1.xml')" name="entryFile" scope="default"
>>> type="STRING"/>
>>> <log level="custom">
>>>             <property name="NAME" expression="$ctx:entryFile"
>>> scope="default" type="STRING"></property>
>>> </log>
>>>
>>> But when I try below code to fetch particular value, it shows blank:-
>>> <log level="custom">
>>>             <property expression="$ctx:entryFile//localEntry/Names/A"
>>> name="NAME1" scope="default" type="STRING"/>
>>>                 <property 
>>> expression="$ctx:entryFile//localEntry/Names/A/text()"
>>> name="NAME2" scope="default" type="STRING"/>
>>>   </log>
>>>
>>> Any help please here
>>>
>>> Thank you,
>>> Aman
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Shakila Sasikaran
>> Software Engineer
>> Mobile :+94 (0) 77 526 6848
>> [email protected]
>> WSO2, Inc.
>> lean . enterprise . middleware
>> http://www.wso2.com/
>>
>


-- 
Shakila Sasikaran
Software Engineer
Mobile :+94 (0) 77 526 6848
[email protected]
WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to