我试图设置此表达式,以获取输出文件名,作为城市名称和文件扩展名之间的连接:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="WriteFile_City" xmlns="http://ws.apache.org/ns/synapse">
<property expression="concat(json-eval($.city.name),'.xml')"
name="transport.vfs.ReplyFileName" scope="transport"
type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="vfs:file:///C:/myFolder"/>
</endpoint>
</send>
</sequence>
如果我仅尝试插入城市名称,则可以使用:第三行是
<property expression="json-eval($.city.name)"
这样,我将输出保存在名为“伦敦”的文件中。但是我需要将输出另存为“ London.xml”,但是我无法理解此concat函数的问题所在。
您是否尝试过fn:concat(json-eval($。city.name),'。xml')而不是简单的concat(....)吗?我知道在使用带有某些表达式的函数时已经添加了问题。我通常也尝试先声明一个属性,然后像使用它一样
<property expression="json-eval($.city.name)" name="city"/>
<property expression="concat(get-property('city'),'.xml')"
name="transport.vfs.ReplyFileName" scope="transport"
type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句