The entity name must immediately follow the '&' in the entity reference


Article ID: 49047


Updated On:


CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) Workload Automation Agent CA Process Automation Base



If information pulled from another location, such as Service Desk contains a special character and is handled in a Pre or Post execution code script PAM will interpret the character as is and will cause an error to occur similar to:

Error Message: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference


This is because PAM is not encoding the special characters in anyway and they must be encoded prior to use in a similar way to the following examples:

Process.outputString = Process.inputString.replace(/&/g, "&"); 	
Process.outputString = Process.outputString.replace(/</g, "&lt;"); 	
Process.outputString = Process.outputString.replace (/>/g, "&gt;"); 	
Process.outputString = Process.outputString.replace (/"/g, "&quot;"); 	
Process.outputString = Process.outputString.replace (/'/g, "&apos;");     

Please note, inputString and outputString are arbitrary names, and this does not need to be a process level variable. This will replace "< , > , &", etc with the proper entity reference for each character. For example, & becomes &amp; and < becomes &lt;.


Release: ITPASA99000-3.1-Process Automation-Add On License for-CA Server Automation