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

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

book

Article ID: 49047

calendar_today

Updated On:

Products

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

Issue/Introduction

Description:

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

Solution:

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;");     
21104545-1=

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;.

Environment

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