2 Replies Latest reply on Oct 3, 2007 5:35 AM by RaxitDJ

    XML Data formating in Flex

    RaxitDJ
      Hi
      I have a small problem in formatting the XML-data in Flex. Need help on the same please!
      I want to generate mx:Panel (s) depending upon the number of "animal" elements derived automatically eg. in this case the code has to fetch how many "animal" of type "type" nodes are there (4 in this case), and put the related "text" elements inside each panel. So here, I am expecting 4 panels, having 2 panels of each "type"
      The object goes like this:
      private var myAnimals:XML =
      <animals id="78">
      <animal id="1">
      <slNo>1</slNo>
      <text>Dimensions 3.36</text>
      <text>booz</text>
      <text>Talking</text>
      <imageUrl>images/abcd.jpg</imageUrl>
      <type>CAT</type>
      <name>John</name>
      <dept>IT</dept>
      </animal>
      <animal id="2">
      <slNo>2</slNo>
      <text>Dimensghhjions 3.36</text>
      <text>booz</text>
      <text>Talking</text>
      <imageUrl>images/abcd.jpg</imageUrl>
      <type>CAT</type>
      <name>John</name>
      <dept>IT</dept>
      </animal>
      <animal id="3">
      <slNo>3</slNo>
      <text>Dimensions 3.36</text>
      <text>boozm</text>
      <text>Talking</text>
      <imageUrl>images/abcd.jpg</imageUrl>
      <type>DOG</type>
      <name>Johnson</name>
      <dept>ITER</dept>
      </animal>
      <animal id="4">
      <slNo>4</slNo>
      <text>Dimensions 3.36</text>
      <text>boozm</text>
      <text>Talking</text>
      <imageUrl>images/abcd.jpg</imageUrl>
      <type>DOG</type>
      <name>Jonathon</name>
      <dept>ITER</dept>
      </animal>
      </animals>