0 Replies Latest reply on Oct 9, 2006 5:44 AM by Keith Dodd

    XMLList and XML an e4x

    Keith Dodd
      Am trying to develop a small flex app using 2 different xml sheets, calling with mx:Httpservice.

      <mx:HTTPService id="photosIn" url="TeaseGallery/gallery.xml" showBusyCursor="true" resultFormat="e4x" result="galleryXMLReceived(event)" />
      <mx:HTTPService id="ellenIn" url="Resources/aboutEllen.xml" showBusyCursor="true" resultFormat="e4x" result="ellenXMLReceived(event)" />

      The "photosIn" includes a repeating portion of:
      <photos>
      <pic></pic>
      <pic></pic> etc

      For that I used
      [Bindable]
      private var dsPics:XMLList;
      and
      dsPics = event.result..photos.pic;

      This seemed to work as expected as I passed to a gallery component.

      My "ellenIn" service uses a simple xml without any repeating regions:
      <aboutEllen>
      <pic>Ellencamera.jpg</pic>
      <ellenName>Ellen Pons</ellenName>
      <info><![CDATA[<h3>Ellen Blackwell Pons</h3>
      Country Life Farm is located in Maryland and experiences the four seasons that the Mid-Atlantic Region offers.<br /><br />Although each season brings special challanges for operating a farm, together they provide the scope of beauty nature offers.<br /><br />Ellen Blackwell Pons lives Country Life Farm 24 hours a day and captures the changing seasonsand the farm and racing scenes with her ever-ready camera.]]>
      </info>
      </aboutEllen>

      It would seem that the XMLList is not the appropirate form here, since no repeating.

      I'd like to send the xml to my "about" component and then parse the various segments there.

      I tried:
      [Bindable]
      private var dsEllen:XMLList;
      and
      dsEllen = event.result..aboutEllen;
      but on an Alert.show, it shows nothing.

      If I change dsEllen:XML, I get errors.

      Obviously, I'm not understanding quite how to work with e4x raw data here.

      Would appreciate any help!
      Thanks
      Keith