How to escape apostrophe in WSO2 property XPath ex

2020-04-17 06:45发布

问题:

My problem is to quote the values obtained from get-property('cf') in <property expression="fn:concat(get-property('whereConcat'),' AND PA_INATO=', get-property('cf'))" name="whereConcat" scope="default" type="STRING"/>

I have tried in different ways(character encoding:&apos;, character escape: \') but without success.

回答1:

the cleanest way is to define a constant:

<property name="apos" scope="default" type="STRING" value="'"/>

and then use it as follow:

<property expression="fn:concat(get-property('whereConcat'),' AND PA_INATO=',get-property('apos'), get-property('cf'),get-property('apos'))" name="whereConcat" scope="default" type="STRING"/>