Thanks Viraj and Harsha

Regards,
Sohani

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog     :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine


On Tue, Jun 3, 2014 at 2:58 PM, Harsha Kumara <[email protected]> wrote:

> Sorry I didn't noticed it before. You will needs to enable xpath 2.0
> support as suggest by Viraj.  Otherwise you should be able to use string
> concat function in xpath 1.0.
>
>
> On Tue, Jun 3, 2014 at 2:38 PM, Viraj Rajaguru <[email protected]> wrote:
>
>> Hi Sohani,
>>
>> Since 'string-join' is a XPath 2.0 function, It seems you have to enable
>> xpath 2.0 support in ESB [1]
>>
>> Thanks,
>> Viraj.
>>
>> [1]
>> http://mytecheye.blogspot.com/2013/01/wso2-esb-enable-xpath-20-in-wso2-esb.html
>>
>>
>> On Tue, Jun 3, 2014 at 2:20 PM, Sohani Weerasinghe <[email protected]>
>> wrote:
>>
>>> Hi Harsha,
>>>
>>> I tried that as well, but it is not supporting in ESB as i mentioned
>>> previously.
>>>
>>> Thanks,
>>> Sohani
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog     :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>>
>>> On Tue, Jun 3, 2014 at 2:08 PM, Harsha Kumara <[email protected]> wrote:
>>>
>>>> Hi Sohani,
>>>> May be your expression syntax is incorrect. Is it works when it change
>>>> like  expression="fn:string-join(('name','age'), '-').I'm referring to
>>>> [1].
>>>>
>>>> [1]-http://www.xqueryfunctions.com/xq/fn_string-join.html
>>>> THanks,
>>>> Harsha
>>>>
>>>>
>>>>  On Tue, Jun 3, 2014 at 1:36 PM, Sohani Weerasinghe <[email protected]>
>>>> wrote:
>>>>
>>>>>  Hi All,
>>>>>
>>>>> I am using an XPATH expression as follows,
>>>>>
>>>>> <sequence xmlns="http://ws.apache.org/ns/synapse"; name="sequence1">
>>>>>    <log level="custom">
>>>>>       <property xmlns:ns="http://org.apache.synapse/xsd"; 
>>>>> xmlns:fn="http://www.w3.org/2005/xpath-functions"; name="insq" 
>>>>> expression="fn:string-join('name','age', '-')"/>
>>>>>    </log>
>>>>>    <drop/>
>>>>> </sequence>
>>>>>
>>>>> When I invoke the proxy I am getting an error as follows
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> SynapseXPath Evaluation of the XPath expression 
>>>>> fn:string-join('name','age', '-') resulted in an error
>>>>>
>>>>> org.jaxen.UnresolvableException: No Such Function 
>>>>> {http://www.w3.org/2005/xpath-functions}:string-join
>>>>>
>>>>>   at 
>>>>> org.jaxen.SimpleFunctionContext.getFunction(SimpleFunctionContext.java:127)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.util.xpath.SynapseXPathFunctionContext.getFunction(SynapseXPathFunctionContext.java:93)
>>>>>
>>>>>   at org.jaxen.ContextSupport.getFunction(ContextSupport.java:242)
>>>>>
>>>>>   at org.jaxen.Context.getFunction(Context.java:216)
>>>>>
>>>>>   at 
>>>>> org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:172)
>>>>>
>>>>>   at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
>>>>>
>>>>>   at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
>>>>>
>>>>>   at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213)
>>>>>
>>>>>   at org.jaxen.BaseXPath.evaluate(BaseXPath.java:172)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:297)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.MediatorProperty.getEvaluatedExpression(MediatorProperty.java:138)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.builtin.LogMediator.setCustomProperties(LogMediator.java:192)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.builtin.LogMediator.getCustomLogMessage(LogMediator.java:131)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.builtin.LogMediator.getLogMessage(LogMediator.java:117)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.builtin.LogMediator.mediate(LogMediator.java:91)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)
>>>>>
>>>>>   at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
>>>>>
>>>>>   at 
>>>>> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
>>>>>
>>>>>   at 
>>>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>>>>
>>>>>   at 
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>
>>>>>   at 
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>
>>>>>   at java.lang.Thread.run(Thread.java:722)
>>>>>
>>>>>
>>>>> According to [1] it states the string-join function should be as
>>>>> follows,
>>>>>
>>>>> fn:string-join(('name','age'), '-') - with two brackets but when I try to 
>>>>> do so, ESB doesn't support this.
>>>>>
>>>>> [1]
>>>>> http://www.w3.org/TR/2014/REC-xpath-functions-30-20140408/#func-string-join
>>>>>
>>>>> Can someone please state the correct way of writing the XPATH
>>>>> expression ?
>>>>>
>>>>> Thanks,
>>>>> Sohani
>>>>>
>>>>> Sohani Weerasinghe
>>>>> Software Engineer
>>>>> WSO2, Inc: http://wso2.com
>>>>>
>>>>> Mobile  : +94 716439774
>>>>> Blog     :http://christinetechtips.blogspot.com/
>>>>> Twitter  : https://twitter.com/sohanichristine
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Harsha Kumara
>>>> Software Engineer, WSO2 Inc.
>>>> Mobile: +94775505618
>>>> Blog:harshcreationz.blogspot.com
>>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Viraj Rajaguru
>> Software Engineer
>> WSO2 Inc. : http://wso2.com
>>
>> Mobile: +94 77 3683068
>>
>>
>>
>>
>
>
> --
> Harsha Kumara
> Software Engineer, WSO2 Inc.
> Mobile: +94775505618
> Blog:harshcreationz.blogspot.com
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to