If you trace it as a string, then you'll see the CDATA. If you trace it as XML then you will not see the CDATA.

ElectroServer is a multiuser chat server that Mike (my coworker) and I created a few years ago. The chat client uses this method to send funky data that normally would break the text node. It works.

So I would just test it out with what ever application you are communicating with to see if it worked. Even if you can't see the CDATA after converting it to XML.

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 919-609-0408
mobile: 919-610-5754
fax: 919-341-8104
----- Original Message ----- From: "Diego Guebel" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Wednesday, November 02, 2005 5:31 PM
Subject: Re: [Flashcoders] createTextNode with CDATA


jobe, it seems I'm doing something wrong.
here is my code:
__xmlString += "<attr id=\"" + obj.screenInputValues[i].id + "\" name=\"" + obj.screenInputValues[i].name + "\"><![CDATA[\" + obj.screenInputValues[i].value + "]]></attr>";

this is an ouptput example:
<attr id="731" name="learn">1</attr>

it prints all the values but not the CDATA around the "1".

do I miss something?
Cheers, Diego.

Jobe Makar wrote:

In Flash I've always opted to create XML as a string, and then when I'm done do this:
var myXML:XML = new XML(theString);

If you do it that way then CDATA definately works.

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 919-609-0408
mobile: 919-610-5754
fax: 919-341-8104
----- Original Message ----- From: "Chris Allen" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Wednesday, November 02, 2005 4:57 PM
Subject: Re: [Flashcoders] createTextNode with CDATA


There is no way to create an actual CDATA node in Flash, at least not
with Version 8 or lower.  You have to resort to escaping the string so
that it doesn't have invalid characters or not use XMLNode for this.

-Chris

On 11/2/05, Diego Guebel <[EMAIL PROTECTED]> wrote:

hey guys,
I want to create a xml node with CDATA, I'm doing in this way:

var temp:XMLNode = doc.createTextNode("<![CDATA[" +
obj.screenInputValues[i].value + "]]>");

the issue is that it prints &lt; in the output.
<attr name="learn" id="731">&lt;![CDATA[some text]]&gt;</attr>

any pointer on this,
cheers, Diego.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to