Coldfusion: Escape special or xml characters from Coldfusion content that may contain html

Platform:Coldfusion
Task:Escape special or xml characters from Coldfusion content that may contain html
Discussion:
[CDATA[ This is the description. ]] Make sure you escape any characters that might cause your XML to invalidate, these characters include <, >, & - I like to enclose any content that may contain HTML inside a CDATA section. Note: In CFML you can use the XmlFormat function to escape special characters in XML.
Example:
<description>[CDATA[ This is the description. ]]</description>
</item>
<!-- put more items here -->

Make sure you escape any characters that might cause your XML to invalidate, these characters include <, >, & - I like to enclose any content that may contain HTML inside a CDATA section.

    Note: In CFML you can use the XmlFormat function to escape special characters in XML.
Back to Index