AS2's XML class is available in AS3 as XMLDocument. So if you want you can work with this old xml class. I advise against doing this. Do not mix or otherwise confuse it with the new e4x XML class. If you want to stay on this path, debug your code, find out what is not working.
Or, start back at the beginning. What are you trying to accomplish? Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of siva.flex Sent: Tuesday, August 28, 2007 9:59 AM To: [email protected] Subject: [flexcoders] Re: converting mxml data to xml code Hi Tracy, Ofcourse it may be flex 1.x/as2 ... have u any idea about the methods that used in this class. I modified this line of code xml.appendChild(xml.createElement(nodeName)); as var xml1:XMLDocument=new XMLDocument(); xml.appendChild(xml1.createElement(nodeName)); becaz I found createElement() method in XMLDocument class. When I tried to display xml in jsp its displaying nothing. Have u any idea of this.Hope soon reply from ur side. Becaz I am lot of trouble. Thanks & Regards, Siva Kumar. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > I am pretty sure that is the Flex 1.x / AS2 utility. > > Tracy > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of siva.flex > Sent: Tuesday, August 28, 2007 1:13 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > 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> <mailto:flexcoders% 40yahoogroups.com> > , "Daniel Freiman" <FreimanCQ@> > wrote: > > > > Not working how? > > > > - Dan > > > > On 8/27/07, siva.flex <siva.flex@> 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 > > > > > > > > > > > >

