Hello
In one of my application i require to convert XML to ArrayCollection
I found one code snippet which help me to do same.
// Code Snippet
private function xmlToArrayCollection ( xml : XML ) : ArrayCollection
{
var xmlDoc : XMLDocument = new XMLDocument(xml.toString());
var decoder : SimpleXMLDecoder = new SimpleXMLDecoder(true)
var resultObj : Object = decoder.decodeXML(xmlDoc);
var menuArrColl : ArrayCollection = new ArrayCollection( new
Array( resultObj.menu.menuItems.menuItem ) ); // dynamic path
return menuArrColl;
}
make sure that u pass actual source items of the resultObj.
like here i have pass // resultObj.menu.menuItems.menuItem //
to generate ArrayCollection it may defer in your xml structure.
may it helps you.
Thanks
Virat
On Apr 27, 12:41 pm, Sindhu <[email protected]> wrote:
> Can someone tell me how to convert an xml file into an array
> collection using actionscript.....?
>
> Regards,
> Sindhu.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---