In Flex I want to create XML variable like this but parser complains about CDATA in publisher tag:
<mx:Script>
<![CDATA[
private var myXML:XML = <book>
<name>AatII</name>
<author>gacgtc</author>
<pages>0</pages>
<publisher><![CDATA[Journal name]]></publisher>
</book>;
]]>
</mx:Script>
But this works fine:
<mx:XML id="myXML">
<book>
<name>AatII</name>
<author>gacgtc</author>
<pages>0</pages>
<publisher><![CDATA[Journal name]]></publisher>
</book>
</mx:XML>
How do I pass xml text with CDATA into XML variable being in MXML Script?