Character Entities & CDATA
Special characters that have meaning in XML markup must be escaped in text content and attribute values. CDATA sections provide an alternative escape mechanism for blocks of text with many special characters.
Syntax
xml-fundamentals
& — & (ampersand)
< — < (less than)
> — > (greater than)
" — " (double quote)
' — ' (apostrophe)
&#NNNN; — Unicode decimal
&#xHHHH; — Unicode hex
<![CDATA[ ... ]]> — escape blockExample
xml-fundamentals
<description>AT&T sells widgets < $10</description>
<code><![CDATA[
if (a < b && b > 0) {
console.log("AT&T wins!");
}
]]></code>