How to handle special character & in xml file?

I have code that will generate an XML file and from there I generate a PDF file. The problem that I am having is that I am creating the XML files for supplier names and yes, the supplier name may be listed as ‘John Gray & Sons’.

How can I get the name of John Gray & Sons into the xml file and than having it appear correctly in the PDF as ‘John Gray & Sons’.

I thought that I could have a hidden field on the form that would check if the supplier name contained the ‘&’ and change that to ‘&amp’ so the name of ‘John Gray & Sons’ would than read as ‘John Gray &amp Sons’, but that didn’t work for me.

Anyones thoughts on how to handle this?

Thanks,

Jean

Subject: How to handle special character & in xml file?

Just to let everyone know the solution,

    @ReplaceSubstring(supplier1;"&";"&") 

I had left the semi-colon off.

Here is what the formula was that I used for the field:

FIELD supplier1 := @If(supplier != “”; supplier; supplier_OneTime);

FIELD holdsupplier := @If(@Contains(supplier1; “&”);@ReplaceSubstring(supplier1;“&”;“&”);supplier1);

holdsupplier