Yeah, it looks like this was as2 and uses the XML classes that were moved
into the flash.xml package for legacy support.  What you did looks like it
should work.
Have you traced toString() of the XMLDocument after the function has been
run?
If you're trying to display the xml in a jsp page, is the page trying to
render the xml instead of displaying it as text.  If so, the xml would be in
the source of the returned page, but you wouldn't see it in a browser.
How are you getting the XMLDocument to a jsp page?

- Dan Freiman

On 8/28/07, siva.flex <[EMAIL PROTECTED]> wrote:
>
>   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] <flexcoders%40yahoogroups.com>, "Tracy
> Spratt" <[EMAIL PROTECTED]> wrote:
> >
> > I am pretty sure that is the Flex 1.x / AS2 utility.
> >
> > Tracy
> >
> > ________________________________
> >
> > From: [email protected] <flexcoders%40yahoogroups.com>
> [mailto:[email protected] <flexcoders%40yahoogroups.com>] On
> > Behalf Of siva.flex
> > Sent: Tuesday, August 28, 2007 1:13 AM
> > To: [email protected] <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] <flexcoders%40yahoogroups.com><mailto:
> flexcoders% <flexcoders%25>
> 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
> > > >
> > > >
> > > >
> > >
> >
>
>  
>

Reply via email to