When I define the following expression in Mule, Mule provides an error stating the following...
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 Statement:
<when expression="#[(sessionVars['varCountMule'] <= 18) && (message.payload == null)]">
Why wouldn't Mule evaluate the && operator correctly?
&
is one of the characters that have a special meaning in XML, and the exception message is due to the parser expecting that special usage.
To use it for something else in an XML document, you need to encode it as &
. So, just replace your &&
with &&
.