Some characters cannot be used inside the value of a node or attribute within an XML file.
The characters are:
Original character  | Escaped character  | 
"  | "  | 
'  | '  | 
<  | <  | 
>  | >  | 
&  | &  | 
The table above indicates, that you should use the sequence for the escaped character instead of the original character on the left.
Another way to get around the limitation of the invalid characters is to include the value within a CDATA sequence like so:
This means e.g. that this node is valid:
<Company_Name>![CDATA[InterForm & Kim A/S]]</Company_Name>
This section explains how you can repair an invalid input XML file and make it valid even though one or more invalid characters might be found in a value and the <![CDATA[ sequence mentioned above is not used.
A prerequisite for this is, that you can list the nodes with this potential problem.
In this example we get an XML file with this node:
<Company_Name>InterForm & Kim A/S</Company_Name>Which makes the XML file invalid.
What we need to do is to search for the string: <Company_Name> and then replace it with <Company_Name>![CDATA[ and also search for the string </Company_Name> and replace this with ]]</Company_Name>.
This can be done with a velocity template, which in InterFormNG2 can be used as a mail-template.
The velocity template can be setup like this as the contents:
#set( $out = $payload.replace("<Company_Name>", '<Company_Name><![CDATA[').replace("</Company_Name>", ']]></Company_Name>') )
${out}A prerequisite for this is, that a variable, payload has been defined and filled with the contents of the (invalid) input XML file prior to calling this mail-template. So the first step is to copy the line above to a simple text file with the extension .vm and upload that as a mail-template in InterFormNG2.
This mail-template can now be used in a workflow that looks like below: