不能使用&&运算符用于选择组件中的属性时

时间:2014-05-19 10:54:07

标签: mule mule-studio mule-el

当我在Mule中定义以下表达式时,Mule会提供一个错误,说明以下内容......

ERROR 2014-05-19 11:48:51,189 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

Mule声明:

<when expression="#[(sessionVars['varCountMule'] &lt;= 18) && (message.payload == null)]">

为什么Mule不会评估&amp;&amp;操作员是否正确?

2 个答案:

答案 0 :(得分:4)

&是XML中具有特殊含义的字符之一,异常消息是由于解析器期望特殊用法。

要将其用于XML文档中的其他内容,您需要将其编码为&amp;。因此,只需将&&替换为&amp;&amp;

More info on the subject.

答案 1 :(得分:0)

使用and代替&&

相关问题