Sure...the reason is that in all the xml files I'm pulling in, I know the 
structure, it's the same for all.  There's only one <item> tag in each xml 
file.  So, I don't need an xmllist, given that there's only one item, I can 
just call toString().  But, I see where you're coming from with an xmllist.  
That would be the way I'd go if there were more than one <item> tags in each 
file.  Maybe the name of the tag, item, is misleading.  I suppose that would be 
a case of semantics.

Ultimately, I only need to call this line (using Greensock's XMLLoader):
private static function getTextContentComplete(le:LoaderEvent):void{
        var xmlData:XML = XML(le.target.content);
        var cdataContent:String = xmlData.toString();
        // not needed...strip CDATA tags: string.replace(new 
RegExp("(^\<!\[CDATA\[)(.+)(\]\]\>)", "gi"), "$2");
        // populate my textfield.htmlText with cdataContent;
}

Each xml file I read in has this structure:
===============================================
<?xml version="1.0" encoding="utf-8"?>
<item>
<![CDATA[some html formatted text]]>
</item>


Hope that's all clear.
- MM




OK, maybe I don't understand your XML structure.  Why would what you settled on:

   var kids:XMLList = xmlData.children();
   var kidscdata:String = kids[0].toString();

be a better solution for you than this?

   var myString:String = xmlData[0].text();

Can you post some sample XML?

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

Reply via email to