Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integer to String Convertion in XSLT

In my WSO2 ESB project , I am using xslt files for transformation. I need to manage the type of the values from the endpoint. My payload is JSON and legacy systems's payload is also JSON. I am trying to change the integer value to string value.

Tried to use script in sequence taking payload and using js but I need to manage it in xslt.

For example ;

<xsl:if test="//jsonObject/searchTerm"> <searchTerm><xsl:value-of select="//jsonObject/searchTerm"/></searchTerm> </xsl:if>

searchTerm value is an integer value from the endpoint but i need to transfer it as string to other system. Could you please advise about this issue?

like image 685
Dilara Şeyma Şahbaz Avatar asked Sep 10 '26 23:09

Dilara Şeyma Şahbaz


1 Answers

Could you try this,

 <xsl:if test="//jsonObject/searchTerm">
   <searchTerm>@@@<xsl:value-of select="//jsonObject/searchTerm"/></searchTerm>
 </xsl:if>
like image 169
karacaoglanb Avatar answered Sep 12 '26 18:09

karacaoglanb