7 Replies Latest reply on Oct 13, 2010 8:58 AM by rtalton

    Transverse of xml

    bryant_16 Level 1

      Hey guys,

       

      Currently I have this passed back to me in the form of XML from php:

       

      <row>

           <geom>

                <inner>      

                     <coord>234324</coord>

                     <coord>34r43r43r</coord>

                     <coord>43r4r4343</coord>

                     <coord>234234</coord>

                 </inner>

                 <inner>

                     <coord>234324</coord>

                     <coord>34r43r43r</coord>

                     <coord>43r4r4343</coord>

                     <coord>234234</coord>

                 </inner>

          </geom>     

      </row>

       

      <row>

           <geom>

                <inner>

                     <coord>678678678</coord>

                     <coord>56745674</coord>

                     <coord>34653</coord>

                     <coord>3465346</coord>

                </inner>

           </geom>

      </row>

       

      My question here is how do I loop through this XML to get the results of the coord that I want from the XML because somethings there will be 1 <inner> tag, sometimes there will be more than 1 <inner> tag

       

      What I have currently is this:

       

      for each(var line:XML in resultXML.row)

      {

           var lengths:uint = line.geom.inner.length(); //first result = 2 // second result = 1

           for (var count:uint=0; count<lengths; count++)

           {

                ***** how to continue from here, because let's say first result =2, then I will have to take in 2 inner tags results in it***

           }

      }

       

      The reason why I start with resulXML.row is because there are other fixed tags inside the resultXML that I need so I started off with resultXML.row inside the for each statement.

       

      Any help will be greatly appreciated.