What I want to do is something like:class one { var x:XML; function addNode(parent:xmlNode) { var child:XMLNode=new XMLNode(3,"<!CDATA[<"+stuff+">]]>"); parent.appendChild(child); } function go():String { return x.toString();} But what happens is the child node toString() produces "<..."So when go() runs I get something like "<parent><..." What I want to do is have an XML object output a string that contains a CDATA node. The above example is greatly simplified. I actually have a class hierarchy, where the classes extend what is stored in the XML, and one of the derived classes needs to store CDATA. Thanks. --- On Wed, 5/11/11, Karl DeSaulniers <k...@designdrumm.com> wrote:
From: Karl DeSaulniers <k...@designdrumm.com> Subject: Re: [Flashcoders] How do I create a CDATA node using AS2? To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com> Date: Wednesday, May 11, 2011, 10:25 PM In the xml node itself, the nodes content wrapped CDATA in the XML or the result of that node wrapped in CDATA in flash? <xmlnode id="<![CDATA[nodename]]>"> <xmlnode> or <xmlnode id="nodename"> <![CDATA[noderesult]]> <xmlnode> or var result = "<![CDATA["+this.xmlNode.firstchild.childNodes[i].childNodes[0].firstChild.nodeValue+"]]>"; HTH, Karl On May 11, 2011, at 9:08 PM, jimlaf...@yahoo.com wrote: > I am using an xml object and need to have a cdata node written out when I use > toString() on the XML object > > On May 11, 2011, at 7:50 PM, Karl DeSaulniers <k...@designdrumm.com> wrote: > > <![CDATA[hello]]> > > > On May 11, 2011, at 6:45 PM, Jim Lafser wrote: > > Anyone know how to create a CDATA node when writing XML in AS2?I tried > Google. I looked in the books I've got.I tried extending XMLNode.I've had no > success. > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Karl DeSaulniers > Design Drumm > http://designdrumm.com > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders