[Dev] [ESB] Unable to use apostrophe in fn:concat() Xpath function

2014-06-24 Thread Ishara Premadasa
Hi all,

I need to use a string which contains apostrophe character ( ' )  with
fn:concat function. Tried with the below ways and none seems to be working.

1. property name=myProp
   expression=fn:concat(' This isapos;', ' my function')
   scope=default
   type=STRING/

This got saved and changed to fn:concat(' This isamp;apos;', ' my
function') internally however when the output is logged it is like ' this
is apos my function'.

2. I then enabled XPath 2.0 in synapse.properties and tried with below as
per 2.0 spec [1].
property name=myProp
   expression=fn:concat('this is''', ' name')
   scope=default
   type=STRING/

This didn't get saved and throws invalid xpath expression error. Tried in
both admin console and Dev studio but any method was not able to get the
apostrophe character appear. I am using ESB 4.8.1 in Windows 7, JDK 1.7_60.

Thanks!
Ishara

[1] http://www.w3.org/TR/xpath20/#doc-xpath-EscapeApos

-- 
Ishara Premasada
Software Engineer,
WSO2 Inc. http://wso2.com/


*Blog   :  http://isharapremadasa.blogspot.com/
http://isharapremadasa.blogspot.com/Twitter   :
https://twitter.com/ishadil https://twitter.com/ishadilMobile   : +94
714445832*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB] Unable to use apostrophe in fn:concat() Xpath function

2014-06-24 Thread Ishan Jayawardena
Hi Ishara,
This worked for me,

expression=fn:concat(*quot;*This is*apos;quot;*, *quot;*my function
*quot;*)

First, we are surrounding the strings with double quotes and then insert
the apostrophe (not sure if this is same as the single quote mark).

Thanks,
Ishan.


On Wed, Jun 25, 2014 at 9:35 AM, Ishara Premadasa ish...@wso2.com wrote:

 Hi all,

 I need to use a string which contains apostrophe character ( ' )  with
 fn:concat function. Tried with the below ways and none seems to be working.

 1. property name=myProp
expression=fn:concat(' This isapos;', ' my function')
scope=default
type=STRING/

 This got saved and changed to fn:concat(' This isamp;apos;', ' my
 function') internally however when the output is logged it is like ' this
 is apos my function'.

 2. I then enabled XPath 2.0 in synapse.properties and tried with below as
 per 2.0 spec [1].
 property name=myProp
expression=fn:concat('this is''', ' name')
scope=default
type=STRING/

 This didn't get saved and throws invalid xpath expression error. Tried in
 both admin console and Dev studio but any method was not able to get the
 apostrophe character appear. I am using ESB 4.8.1 in Windows 7, JDK 1.7_60.

 Thanks!
 Ishara

 [1] http://www.w3.org/TR/xpath20/#doc-xpath-EscapeApos

 --
 Ishara Premasada
 Software Engineer,
 WSO2 Inc. http://wso2.com/


 *Blog   :  http://isharapremadasa.blogspot.com/
 http://isharapremadasa.blogspot.com/ Twitter   :
 https://twitter.com/ishadil https://twitter.com/ishadilMobile   : +94
 714445832 %2B94%20714445832*





-- 
Ishan Jayawardena
Senior Software Engineer
Mobile: +94 (77) 408 2330
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev