XSLT 中的整数到字符串转换

Dil*_*baz 3 string xslt integer wso2 wso2-esb

在我的 WSO2 ESB 项目中,我使用 xslt 文件进行转换。我需要管理端点值的类型。我的有效负载是 JSON,遗留系统的有效负载也是 JSON。我正在尝试将整数值更改为字符串值。

尝试按顺序使用脚本获取有效负载并使用 js,但我需要在 xslt 中管理它。

例如 ;

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

searchTerm 值是来自端点的整数值,但我需要将其作为字符串传输到其他系统。您能否就这个问题提出建议?

kar*_*anb 5

你能试试这个吗

 <xsl:if test="//jsonObject/searchTerm">
   <searchTerm>@@@<xsl:value-of select="//jsonObject/searchTerm"/></searchTerm>
 </xsl:if>
Run Code Online (Sandbox Code Playgroud)

  • 您可以将这些添加到 ESB_HOME\conf\synapse.properties `synapse.commons.json.json.output.disableAutoPrimitive.customReplaceRegex=@@@ synapse.commons.json.output.xmloutMultiplePI=true` (2认同)