wso2 - How We Can Break a String in Wso2esb using Xpath -
i wish break string in wso2esb using xpath input
<property name="message" value="assetname:ups,assetcode:452chi,assetid:548935,assetvalue:215" scope="default"/>
i need break in same property using xpath need this
assetname:ups assetcode=452chi assetid=54895 assetvalue=215
for tried tokenize function wso2esb showing errors configure file
<proxy xmlns="http://ws.apache.org/ns/synapse" name="xpathcheck" transports="https,http" statistics="disable" trace="disable" startonload="true"> <target> <insequence> <property name="max" value="1" scope="default" type="string"/> <property name="min" value="1" scope="default" type="string"/> <property name="messagetext" expression="fn:concat('assetid:',get-property('min'),',','assetname:',get-property('max'))" scope="default" type="string"/> <property name="tokenize" expression="fn:tokenize(get-property('messagetext'),',')" scope="default" type="string"/> <log> <property name="messagetext" expression="get-property('messagetext')"/> <property name="tokenize" expression="get-property('tokenize')"/> </log> </insequence> <outsequence/> </target> <description></description> </proxy>
but throwing errors u have idea need store in db table 1 field separate lines error is
error - synapsexpath evaluation of xpath expression fn:tokenize(get-property('messagetext'),',') resulted in error org.jaxen.unresolvableexception: no such function tokenize
tokenize function comes xpath 2.0. enable xpath 2.0 functions uncomment following entry in synapse.properties file located @ $esb_home/repository/conf directory
synapse.xpath.dom.failover.enabled=true
then have specify mediator follows,
<property name="message" value="a,b,c,d,e" scope="default"/> <property xmlns:fn="http://www.w3.org/2005/xpath-functions" name="tokenize" expression="fn:tokenize(syn:get-property('message'),',')" scope="default" type="string"/>
Comments
Post a Comment