One way to do this is to break up the closing CDATA string:
var tmpStr:XML = new XML("<![CDATA[" + notes.text + "]" + "]>");
Tracy
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of hoytlee2000
Sent: Thursday, February 21, 2008 4:44 PM
To: [email protected]
Subject: [flexcoders] CDATA XML element inside mxml
Hello,
I'm getting mixed up on how the syntax to create a CDATA element
inside the script block in the mxml file. I do this and I get a parse
error:
var tmpStr:XML = new XML("<![CDATA[" + notes.text + "]]>");
xmlFile.notes.tag = tmpStr;
results.text = xmlFile.toXMLString();
I tried to use a back slash to escape the "<" and ">" but that
resulted in some inconsistent behavior with the second line when I
read back the xml file as on the mac it reproduced the CDATA block and
on the windows and linux side it removed the CDATA tags. Any help
would be appreciated.
Thanks,
Hoyt