I am pretty sure that is the Flex 1.x / AS2 utility. Tracy
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of siva.flex Sent: Tuesday, August 28, 2007 1:13 AM To: [email protected] Subject: [flexcoders] Re: converting mxml data to xml code Hi Dan, yes it's not working. If u see the documentation of xml u find that createElement() method doesn't exist. And I downloaded the folder and deployed , I tried to access the application, I found lot of warnings and errors. Has it worked for u. Could u suggest me to solve this issue. Have I done any mistake. Thanks & Regards, Siva Kumar --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Daniel Freiman" <[EMAIL PROTECTED]> wrote: > > Not working how? > > - Dan > > On 8/27/07, siva.flex <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > Anydody have the code to convert mxml data to .xml file. I have > > found this code in net. > > > > class XMLUtil { > > > > static function as2xml(obj: Object, nodeName: String) { > > var xml:XML=new XML(); > > xml.appendChild(xml.createElement(nodeName)); > > for (var i in obj) { > > handleItem(xml, obj[i], i); > > } > > return xml; > > } > > > > private static function handleItem(xml, item, nodeName: String) { > > var type=typeof item; > > if (type=="string" || type=="number" || item instanceof Date) > > { > > var el=xml.createElement(nodeName); > > el.appendChild(xml.createTextNode(item)); > > xml.firstChild.appendChild(el); > > } else if (item instanceof Array) { > > for(var i=0; i<item.length; i++) > > handleItem(xml, item[i], nodeName); > > } else if (item instanceof Object) > > xml.firstChild.appendChild(as2xml(item, nodeName)); > > } > > > > } > > > > But its not working. I created relevant as files. Anybody have > > the code to convert to mxml data to xml like above. > > > > Thanks & Regards, > > Siva Kumar > > > > > > >

