escape() is for url encoding, which is not the same as xml encoding. Though
it would work ok, since all the relevent XML special chars would be also
escaped there.

Flash's XML object does not support <![CDATA[]]>. When you load XML
containing CDATA, it simply XML-encodes the contents.

If XML-encoding is enough for you, you can do it like this:

var rawText:String = "blah blah 1 < 2 & 2 > 1!";
var encodedText:XMLNode = new XMLNode(3, rawText);
myXML.firstChild.appendChild(encodedText);

Peter


On 6/6/06, Marlon Harrison <[EMAIL PROTECTED]> wrote:

Is using the escape() function out of the question for your application?

On 6/6/06, Ryan Matsikas <[EMAIL PROTECTED]> wrote:
> The simple answer is: no.
>
> But you can build an XML string with CDATA and write the file or send it
to
> a server with CDATA tags in tact.
>
> On 6/6/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote:
> >
> > Flashcoders,
> >
> > I know it's possible to read from a CDATA tag in Flash... but is it
> > possible
> > to create a CDATA text node via Actionscript?
> >
> > Thanks in advance,
> > -g
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to