3 Replies Latest reply on May 18, 2009 9:47 AM by flexstone

    Please help me extract this xml


      <responseResponse xmlns="http://chatter" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <responseReturn>I want this!!!</responseReturn>


      I have this xml, it's a result from webservice with e4x format. I want this element  <responseReturn>. I have tried this and it came with nothing.


                private function resultService( event:ResultEvent ) :void

                     Alert.show( event.responseResponse.responseReturn.toString() );



      Thanks a lot

        • 1. Re: Please help me extract this xml
          flexstone Level 1


          var res = event.result


          • 2. Re: Please help me extract this xml
            Gregory Lafrance Level 6

            This works, so maybe keep that extra stuff out of the xml:


            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                  import mx.rpc.events.ResultEvent;
                  import mx.collections.XMLListCollection;
                  [Bindable] private var dataXLC:XMLListCollection;
                  private function dataHandler(evt:ResultEvent):void{
                    dataXLC = new XMLListCollection(evt.result.responseReturn as XMLList);
              <mx:HTTPService id="dataSrvc" result="dataHandler(event)"
                resultFormat="e4x" url="data.xml"/>
              <mx:ComboBox dataProvider="{dataXLC}"/>
            <?xml version="1.0" encoding="utf8"?>
               <responseReturn>I want this!!!</responseReturn>
               <responseReturn>And this!!!</responseReturn>
               <responseReturn>And also this!!!</responseReturn>
            • 3. Re: Please help me extract this xml
              flexstone Level 1

              var res = event.result

              var n = res.responseResult.length()



              for(var i=0;i<n;i++){