It's a common question how to encode illegal XML characters such as <, > inside XML. And the experts always tell us to enclose them inside CDATA...
Actionscript Code:<mytag>
<![CDATA[
some illegal < > characters.
]]>
</mytag>
But is that the whole story? What if the string enclosed by CDATA contained the ]]> characters? What if I inserted some XML of my own? This would confuse the E4X parser, wouldn't it?
My particular situation is generating XML in PHP, and parsing it in actionscript. Is there a convention to encoding the sting contained within CDATA... and if so, why don't we just encode and decode to replace illegal XML characters... why do we use CDATA at all?
Or have I got it wrong?