2 Replies Latest reply on Nov 20, 2006 9:53 AM by ntsiii

    XML File Within XML File

      Hi everyone,

      Plz help me out.....

      Currently, I am working on flex and Remote Object Accessing. My problem is that, in my application I have one Servlet which writes .xml file in browser and I use that .xml file to display data in Datagrid. Everything was woking fine. But then I have to change my .xml file in such a way that one of it's node is a .xml file. like this...

      <?xml version="1.0" encoding="UTF-8" ?>
      - <root>
      - <detail>
      <server>SOA </server>
      - <request>
      <?xml version="1.0" encoding="UTF-8" ?>
      - <envelope>

      Here request is one of the node in .xml file. now when i am displaying data in this file into datagrid, datagrid show correct data for <server> and <resp_time> tag. But it shows "[object Object]" for request tag.

      Can any one tell me how can I show that request node into my datagrid ,so that it shows me ..
      <?xml version="1.0" encoding="UTF-8" ?>
      - <envelope>
      instead of [object Object] ???? Please Hepl me
        • 1. Re: XML File Within XML File
          Meflex Level 1
          Tracy had replied me that you can use labelFunction. like this...

          private function lfRequest(oItem:Object, dgc:DataGridColumn):String
          return oItem.request.toXMLString()

          I have used resultHandler like this ....

          var xmlFile:String = null;
          private function resultHandler(event:ResultEvent):void

          trace("resultHandler is called...");

          var myO:Object = new Object();
          myO = event.result;

          trace("after new XML()");


          trace("after toString()");


          and i m trying to display that ' xmlFile:String' into datagrid, but it gives me this runtime-error:

          Error #1009: Cannot access a property or method of a null object reference.

          then i tryed this...

          xmlFile=myO.request.root.detail.toXMLString(); then it gives me this error message :

          Error #1009: Cannot access a property or method of a null object reference.

          plz help me...
          • 2. Re: XML File Within XML File
            ntsiii Level 3
            First, make sure your resultFormat="e4x"

            Then in the handler, change to:

            var xmlResult:XML;
            xmlResult= XML(event.result);