]]> is the closing tag to the mx:Script’s escaped innards.

 

<mx:Script><![[CDATA

 

[…]

 

]]>

</mx:Script>

 

The xml parser ignores all markup between the opening and first closing
cdata tags, so even though it’s quoted it’s still recognized as a cdata
closing tag.

 

To get around it, try this:

 

 

            var tmpStr:XML = new XML("<![CDATA[asdf]]"+">");

 

Note that I’ve separated “]]>” into “]]”+”>”

 

Beau Scott

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of hoytlee2000
Sent: Thursday, February 21, 2008 2: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

 

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.9/1291 - Release Date: 2/21/2008
11:05 AM


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.9/1291 - Release Date: 2/21/2008
11:05 AM
 
    

<<image001.jpg>>

<<image002.jpg>>

Reply via email to