Name

XMLFormat — New as of ColdFusion 4.5

Synopsis

XMLFormat(string)

Returns string in a format that is safe to use with XML by escaping the following special characters: ampersands (&), double quotes ("), greater than signs (>), less than signs (<), and single quotes('). Example:

<CFSET MyString="Here is an example of the XMLFormat function: 5+5<20">

<CFOUTPUT>#XMLFormat(MyString)#</CFOUTPUT>

<P><I>View the page source to see the escaped text.</I>

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.